diff --git a/.gitignore b/.gitignore index 3859507293f97a79dd91901a80a2197e2615166a..e9b0cb83f05a749e878e533ea20c0aeecdc4b021 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ build hap/.gradle/6.3/executionHistory/ hap/.gradle/6.3/fileHashes/ hap/.gradle/buildOutputCleanup/ +hap/local.properties diff --git a/README.md b/README.md index f98281f65a9ee3f159e953f70e237897af43dd0a..0cc1db4b5abbfabadf77c0c911aca52b53222fb5 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,7 @@ DEMO: * 邮件列表: 暂无 +hdc_std.exe file send main.xe /data/accounts/account_0/appdata/com.openblock.ohos/com.openblock.ohos/com.openblock.ohos.MainAbility/main.xe + +chmod 777 main.xe + diff --git a/connector/openharmonyconnector.js b/connector/openharmonyconnector.js index b784fa3b50e7b21e89672f382d3356619ff85aff..8ee3d8477204d5090515abd8be3c2073c173a8a0 100644 --- a/connector/openharmonyconnector.js +++ b/connector/openharmonyconnector.js @@ -33,7 +33,7 @@ if (!v) { JSPreviewer = null; JSPreviewer_iframe = null; - UB_IDE.removeSubwindowComponent('jspreviewer'); + UB_IDE.removeExtComponent('subwindows','jspreviewer'); } } } @@ -64,7 +64,7 @@ if (!err) { let runProjectCmd = { "cmd": "runProject", "bytes": result, fsm: "Start.Main" }; if (!JSPreviewer_iframe) { - UB_IDE.addSubwindowComponent('jspreviewer'); + UB_IDE.ensureExtComponent('subwindows','jspreviewer'); setTimeout(() => { JSPreviewer_iframe.contentWindow.window.onload = () => { JSPreviewer_iframe.contentWindow.postMessage(runProjectCmd); diff --git a/hap/.gitignore b/hap/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..39187ebed671ccfd399a7e88520b1075926c058e --- /dev/null +++ b/hap/.gitignore @@ -0,0 +1,4 @@ +/node_modules +/local.properties +/.idea +**/build \ No newline at end of file diff --git a/hap/README.md b/hap/README.md deleted file mode 100644 index 948ae597c692f1cb0affce6dbb71b358920fabae..0000000000000000000000000000000000000000 --- a/hap/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# AtomicLayout - -### Introduction - -This sample illustrates style attributes related to layout effect adaptation, including the hiding feature, proportion feature, and fixed ratio. - -With the hiding feature, you can adjust the display priority of components in a container in the horizontal or vertical direction. - -With the proportion feature, you can adjust the proportion of each component in a container so that each of them is always arranged in a proportional space of the container. - -You can scale up or down a component with fixed ratio while retaining its aspect ratio. - -### Usage - -In this sample, there are three buttons on the home screen. You can click them to display the corresponding screen. - -On the feature display screen, the rectangle in light yellow is a container, and it accommodates three components: A, B, and C. You can click the buttons to change the size of the components and display them in different ways. - -### Constraints - -- The hiding and proportion features must be used in a flex layout that does not support cross-row display. -- This sample can only be run on mini-system devices. - diff --git a/hap/README_zh.md b/hap/README_zh.md deleted file mode 100644 index fb0a13b04ddbb13a8d1a3c8d190581be3c81e2f9..0000000000000000000000000000000000000000 --- a/hap/README_zh.md +++ /dev/null @@ -1,23 +0,0 @@ -# 原子布局 - -### 简介 - -本示例展示了布局效果自适应的相关样式属性,包括隐藏能力、占比能力和固定比例。 - -隐藏能力:可以调整组件内元素水平/垂直方向的显示优先级。 - -占比能力:可以调整指定元素始终在容器的某一比例空间中进行布局。 - -固定比例:可以以固定的比例调整组件的宽高尺寸。 - -### 使用说明 - -本示例主界面为三个按钮,点击后在新页面分别展示。 - -在能力展示页面中,浅黄色背景为父容器,A、B、C为其中三个子元素,点击按钮可改变子容器大小,子元素显示会随之改变。 - -### 约束与限制 - -- 隐藏能力与占比能力需在非折行的flex布局中使用。 -- 本示例支持在轻量系统使用。 - diff --git a/hap/build-profile.json5 b/hap/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..413dbce5682b47843614aebd5880dda084165437 --- /dev/null +++ b/hap/build-profile.json5 @@ -0,0 +1,40 @@ +{ + "app": { + "signingConfigs": [ + { + "name": "default", + "material": { + "certpath": "C:\\Users\\Administrator\\.ohos\\config\\openharmony\\auto_ohos.cer", + "storePassword": "00000018D4659CE60A452595A5380056CEC64ABD02FF8B645D2A2414105DE14B89A046AD753F1599", + "keyAlias": "debugKey", + "keyPassword": "00000018F2E89E372997C86EA77B3D5E94E47AEBF65CA6FBD2880B64E3790763423E5689CFE1D8C3", + "profile": "C:\\Users\\Administrator\\.ohos\\config\\openharmony\\auto_ohos_default_com.openblock.ohos.p7b", + "signAlg": "SHA256withECDSA", + "storeFile": "C:\\Users\\Administrator\\.ohos\\config\\openharmony\\auto_ohos.p12" + } + } + ], + "compileSdkVersion": 8, + "compatibleSdkVersion": 8, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/hap/build.gradle b/hap/build.gradle index 4082e5e5329a99aea08d246e62e46f2a66675aee..221dff7a822af31737e9f0d22da7d83a4021c2c3 100644 --- a/hap/build.gradle +++ b/hap/build.gradle @@ -1,22 +1,21 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. apply plugin: 'com.huawei.ohos.app' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 ohos { signingConfigs { debug { - storeFile file('C:\\openharmony\\key1\\openharmony.p12') - storePassword '000000187A7DAD405B3FC2C0DD5A22D71E099DAF1952185044808317227A7B8E1222ADCFBF53B994' - keyAlias = 'openharmony' - keyPassword '000000187828397D1F90A82A02013CB2E0EE8914EB988241276E31A9C535BB1F75BE8D9D66EC3723' + storeFile file('C:\\openharmony\\openharmonySign\\openharmonySign\\myApplication.p12') + storePassword '000000193E18D5D81837A2F38DFAA6366FFF7424CAC5A63EF3CA864D5F65018973039DE62DC15317A9' + keyAlias = 'hapsign' + keyPassword '00000019C9674C1BBC6BB5A041FAFF947C2315345DDE14EADC9E971C2A76CDF4C12CCE0DD625B9F6F5' signAlg = 'SHA256withECDSA' - profile file('C:\\openharmony\\key1\\SgnedReleasedProfileTemplate.p7b') - certpath file('C:\\openharmony\\key1\\openharmony.cer') + profile file('C:\\openharmony\\openharmonySign\\openharmonySign\\SgnedReleasedProfileTemplate.p7b') + certpath file('C:\\openharmony\\openharmonySign\\openharmonySign\\IDE.cer') } } - compileSdkVersion 6 - defaultConfig { - compatibleSdkVersion 6 - } + compileSdkVersion 8 + supportSystem "standard" } buildscript { @@ -27,10 +26,10 @@ buildscript { maven { url 'https://developer.huawei.com/repo/' } - jcenter() } dependencies { - classpath 'com.huawei.ohos:hap:2.4.5.0' + classpath 'com.huawei.ohos:hap:3.0.5.2' + classpath 'com.huawei.ohos:decctest:1.2.7.2' } } @@ -42,6 +41,5 @@ allprojects { maven { url 'https://developer.huawei.com/repo/' } - jcenter() } -} \ No newline at end of file +} diff --git a/hap/entry/.gitignore b/hap/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..4f9a973815d0b5e49bc8547681a6b4bc7a178d12 --- /dev/null +++ b/hap/entry/.gitignore @@ -0,0 +1,3 @@ +/node_modules +/.preview +/build \ No newline at end of file diff --git a/hap/entry/build-profile.json5 b/hap/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..09fbaf41fa38c8543903a0e47561a25e6d983cba --- /dev/null +++ b/hap/entry/build-profile.json5 @@ -0,0 +1,10 @@ +{ + "apiType": 'faMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + } + ] +} \ No newline at end of file diff --git a/hap/entry/build.gradle b/hap/entry/build.gradle index 88e1fd7d4aad2df8c0b60bc3fd818690ace968bf..527e37accecefd059d5f20388ee81be0c1937179 100644 --- a/hap/entry/build.gradle +++ b/hap/entry/build.gradle @@ -1,9 +1,25 @@ apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 ohos { - compileSdkVersion 6 + signingConfigs { + } + +// signingConfigs { +// debug { +// storeFile file('C:\\openharmony\\key1\\openharmony.p12') +// storePassword '000000187A7DAD405B3FC2C0DD5A22D71E099DAF1952185044808317227A7B8E1222ADCFBF53B994' +// keyAlias = 'openharmony' +// keyPassword '000000187828397D1F90A82A02013CB2E0EE8914EB988241276E31A9C535BB1F75BE8D9D66EC3723' +// signAlg = 'SHA256withECDSA' +// profile file('C:\\openharmony\\key1\\SgnedReleasedProfileTemplate.p7b') +// certpath file('C:\\openharmony\\key1\\openharmony.cer') +// } +// } + compileSdkVersion 8 defaultConfig { - compatibleSdkVersion 6 + compatibleSdkVersion 8 } +// arkEnable false buildTypes { release { proguardOpt { @@ -12,5 +28,5 @@ ohos { } } } - supportSystem "standard" -} \ No newline at end of file +} + diff --git a/hap/entry/hvigorfile.js b/hap/entry/hvigorfile.js new file mode 100644 index 0000000000000000000000000000000000000000..bcec4c99653062cbf17702c40a2dd2a7b809b81a --- /dev/null +++ b/hap/entry/hvigorfile.js @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').legacyHapTasks diff --git a/hap/entry/package-lock.json b/hap/entry/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..15bc7145be1490029883067847743ea7134cf545 --- /dev/null +++ b/hap/entry/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "entry", + "version": "1.0.0", + "lockfileVersion": 1 +} diff --git a/hap/entry/package.json b/hap/entry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c7685ac4e7c0d79df04c96744f0d8f22cb4a9025 --- /dev/null +++ b/hap/entry/package.json @@ -0,0 +1,14 @@ +{ + "license": "ISC", + "devDependencies": {}, + "name": "entry", + "ohos": { + "org": "huawei", + "directoryLevel": "module", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": {} +} diff --git a/hap/entry/proguard-rules.pro b/hap/entry/proguard-rules.pro new file mode 100644 index 0000000000000000000000000000000000000000..f7666e47561d514b2a76d5a7dfbb43ede86da92a --- /dev/null +++ b/hap/entry/proguard-rules.pro @@ -0,0 +1 @@ +# config module specific ProGuard rules here. \ No newline at end of file diff --git a/hap/entry/src/main/config.json b/hap/entry/src/main/config.json index 81188f727def5ef46eed0ec30a6ed00c33a01aff..6844e9024979901f5ca318cf5575c282a0c0f985 100644 --- a/hap/entry/src/main/config.json +++ b/hap/entry/src/main/config.json @@ -1,18 +1,28 @@ { "app": { "bundleName": "com.openblock.ohos", + "vendor": "openblock", "version": { "code": 1000000, - "name": "1.0" + "name": "1.0.0" } }, "deviceConfig": {}, "module": { + "reqPermissions": [ + { + "name": "ohos.permission.WRITE_MEDIA" + }, + { + "name": "ohos.permission.INTERNET" + } + ], "package": "com.openblock.ohos", - "name": ".MainAbility", - "mainAbility": "com.openblock.ohos.MainAbility", + "name": ".entry", + "mainAbility": ".MainAbility", "deviceType": [ - "phone" + "phone", + "tablet" ], "distro": { "deliveryWithInstall": true, @@ -20,6 +30,7 @@ "moduleType": "entry", "installationFree": false }, + "srcPath": "", "abilities": [ { "skills": [ @@ -32,12 +43,17 @@ ] } ], + "orientation": "portrait", + "visible": true, + "srcPath": "MainAbility", "name": ".MainAbility", + "srcLanguage": "js", "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", + "description": "$string:MainAbility_desc", + "formsEnabled": false, + "label": "$string:MainAbility_label", "type": "page", - "launchType": "standard" + "launchType": "singleton" } ], "js": [ @@ -45,9 +61,9 @@ "pages": [ "pages/index/index" ], - "name": "default", + "name": ".MainAbility", "window": { - "designWidth": 720, + "designWidth": 750, "autoDesignWidth": false } } diff --git a/hap/entry/src/main/js/default/common/runtime/debugger.js b/hap/entry/src/main/js/MainAbility/app.js similarity index 35% rename from hap/entry/src/main/js/default/common/runtime/debugger.js rename to hap/entry/src/main/js/MainAbility/app.js index 9c9e2f6f09058457a5c05506845605e42994935e..e244b5b7b25b4f76bac73adcf9145ca92ca586e0 100644 --- a/hap/entry/src/main/js/default/common/runtime/debugger.js +++ b/hap/entry/src/main/js/MainAbility/app.js @@ -3,4 +3,11 @@ * Copyright 2021 Du Tian Wei * SPDX-License-Identifier: Apache-2.0 */ - +export default { + onCreate() { + console.info("Application onCreate"); + }, + onDestroy() { + console.info("Application onDestroy"); + } +}; diff --git a/hap/entry/src/main/js/MainAbility/common/canvas.js b/hap/entry/src/main/js/MainAbility/common/canvas.js new file mode 100644 index 0000000000000000000000000000000000000000..6ca1c7d8bd6c97b87e8202c04162c50d4b4422e0 --- /dev/null +++ b/hap/entry/src/main/js/MainAbility/common/canvas.js @@ -0,0 +1,187 @@ +/** + * @license + * Copyright 2021 Du Tian Wei + * SPDX-License-Identifier: Apache-2.0 + */ + "use strict" + + class Vector2 { + // x; y; + constructor(x, y) { + this.x = x; + this.y = y; + } + } + class OBCanvas2D { + // /** + // * @type {HTMLCanvasElement} + // */ + // canvas; + // /** + // * @type {CanvasRenderingContext2D} + // */ + // canvas2dctx; + // /** + // * + // * @param {HTMLCanvasElement} canvas + // */ + constructor(canvas) { + this.canvas = canvas; + this.canvas2dctx = canvas.getContext('2d'); + } + /** + * + * @param {Number} color + */ + setFillStyleColor(color) { + let str_color; + if (color < 0) { + str_color = (Number.MAX_SAFE_INTEGER + color + 1).toString(16).substr(-8) + str_color = '#' + str_color; + } else { + str_color = '#' + color.toString(16).padStart(8, '0'); + } + str_color = "#" + str_color.substring(7) + str_color.substring(1,7); + console.log(str_color); + this.canvas2dctx.fillStyle = str_color; + } + /** + * + * @param {Number} color + */ + setStrokeStyleColor(color) { + let str_color; + if (color < 0) { + str_color = (Number.MAX_SAFE_INTEGER + color + 1).toString(16).substr(-8) + str_color = '#' + str_color; + } else { + str_color = '#' + color.toString(16).padStart(8, '0'); + } + str_color = "#" + str_color.substring(7) + str_color.substring(1,7); + console.log(str_color); + this.canvas2dctx.strokeStyle = str_color; + } + getVector2X(v) { + return v.x; + } + getVector2Y(v) { + return v.y; + } + drawImage8arg(imageName, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight, st) { + let vm = st.fsm.VM; + let asset = vm.assets[imageName]; + if (!asset) { + console.warn('no asset named ' + imageName); + return; + } + let rx = dWidth < 0; + if (rx) { + dx = -dx; + } + let ry = dHeight < 0; + if (ry) { + dy = -dy; + } + if (rx || ry) { + this.canvas2dctx.save(); + this.canvas2dctx.scale(rx ? -1 : 1, ry ? -1 : 1); + } + this.canvas2dctx.drawImage(asset, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight); + if (rx || ry) { + this.canvas2dctx.restore(); + } + } + drawImage4arg(imageName, dx, dy, dWidth, dHeight, st) { + let vm = st.fsm.VM; + let asset = vm.assets[imageName]; + if (!asset) { + console.warn('no asset named ' + imageName); + return; + } + this.drawImage8arg(imageName, 0, 0, asset.width, asset.height, dx, dy, dWidth, dHeight, st); + } + drawImage2arg(imageName, dx, dy, st) { + let vm = st.fsm.VM; + let asset = vm.assets[imageName]; + if (!asset) { + console.warn('no asset named ' + imageName); + return; + } + + this.drawImage4arg(imageName, dx, dy, asset.width, asset.height, st); + } + imageWidth(imageName, st) { + let vm = st.fsm.VM; + let asset = vm.assets[imageName]; + if (!asset) { + console.warn('no asset named ' + imageName); + return 0; + } + return asset.width; + } + imageHeight(imageName, st) { + let vm = st.fsm.VM; + let asset = vm.assets[imageName]; + if (!asset) { + console.warn('no asset named ' + imageName); + return 0; + } + return asset.height; + } + canvasWidth(){ + return 750;//this.canvas.getBoundingClientRect().width; + } + canvasHeight(){ + return 1280;//this.canvas.getBoundingClientRect().height; + } + /** + * 安装到脚本库 + * @param {OBScript} script + */ + install(script) { + script.InstallLib("canvas2d", "canvas2d", [ + script.NativeUtil.closureVoid(this.canvas2dctx.fillRect.bind(this.canvas2dctx), ['DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister']), + script.NativeUtil.closureVoid(this.canvas2dctx.clearRect.bind(this.canvas2dctx), ['DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister']), + // canvas2dctx.fillStyle=color + script.NativeUtil.closureVoid(this.setFillStyleColor.bind(this), ['LongRegister']), + script.NativeUtil.closureVoid(this.canvas2dctx.strokeRect.bind(this.canvas2dctx), ['DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister']), + script.NativeUtil.closureVoid(this.canvas2dctx.fillText.bind(this.canvas2dctx), ['StringRegister', 'DoubleRegister', 'DoubleRegister']), + script.NativeUtil.closureVoid(this.canvas2dctx.beginPath.bind(this.canvas2dctx), []), + script.NativeUtil.closureVoid(this.canvas2dctx.arc.bind(this.canvas2dctx), ['DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister']), + script.NativeUtil.closureVoid(this.canvas2dctx.fill.bind(this.canvas2dctx), []), + script.NativeUtil.closureVoid(this.canvas2dctx.closePath.bind(this.canvas2dctx), []), + script.NativeUtil.fieldSetter(this.canvas2dctx, 'font', 'StringRegister'), + script.NativeUtil.fieldGetter(this.canvas2dctx, 'font', 'StringRegister'), + script.NativeUtil.closureVoid(this.canvas2dctx.arcTo.bind(this.canvas2dctx), ['DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister']), + script.NativeUtil.closureVoid(this.canvas2dctx.bezierCurveTo.bind(this.canvas2dctx), ['DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister']), + script.NativeUtil.closureVoid(this.canvas2dctx.moveTo.bind(this.canvas2dctx), ['DoubleRegister', 'DoubleRegister']), + script.NativeUtil.closureVoid(this.canvas2dctx.lineTo.bind(this.canvas2dctx), ['DoubleRegister', 'DoubleRegister']), + script.NativeUtil.fieldSetter(this.canvas2dctx, 'textAlign', 'StringRegister'), + script.NativeUtil.fieldGetter(this.canvas2dctx, 'textAlign', 'StringRegister'), + script.NativeUtil.fieldSetter(this.canvas2dctx, 'textBaseline', 'StringRegister'), + script.NativeUtil.fieldGetter(this.canvas2dctx, 'textBaseline', 'StringRegister'), + script.NativeUtil.closureVoid(this.canvas2dctx.ellipse.bind(this.canvas2dctx), ['DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'LongRegister']), + script.NativeUtil.closureVoid(this.canvas2dctx.rect.bind(this.canvas2dctx), ['DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister']), + script.NativeUtil.closureVoid(this.canvas2dctx.rotate.bind(this.canvas2dctx), ['DoubleRegister']), + script.NativeUtil.closureVoid(this.canvas2dctx.scale.bind(this.canvas2dctx), ['DoubleRegister', 'DoubleRegister']), + script.NativeUtil.closureVoid(this.setStrokeStyleColor.bind(this), ['LongRegister']), + script.NativeUtil.closureVoid(this.canvas2dctx.stroke.bind(this.canvas2dctx), []), + script.NativeUtil.objFieldGetter('x', 'DoubleRegister'), + script.NativeUtil.objFieldGetter('y', 'DoubleRegister'), +// script.NativeUtil.fieldGetter(this.canvas, 'height', 'LongRegister'), +// script.NativeUtil.fieldGetter(this.canvas, 'width', 'LongRegister'), + script.NativeUtil.closureReturnValue(this.canvasHeight.bind(this), 'LongRegister', []), + script.NativeUtil.closureReturnValue(this.canvasWidth.bind(this), 'LongRegister', []), + script.NativeUtil.fieldSetter(this.canvas2dctx, 'lineWidth', 'DoubleRegister'), + script.NativeUtil.fieldGetter(this.canvas2dctx, 'lineWidth', 'DoubleRegister'), + script.NativeUtil.closureVoid(this.drawImage8arg.bind(this), ['StringRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister'], true), + script.NativeUtil.closureVoid(this.drawImage4arg.bind(this), ['StringRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister', 'DoubleRegister'], true), + script.NativeUtil.closureVoid(this.drawImage2arg.bind(this), ['StringRegister', 'DoubleRegister', 'DoubleRegister'], true), + script.NativeUtil.closureReturnValue(this.imageWidth.bind(this), 'DoubleRegister', ['StringRegister'], true), + script.NativeUtil.closureReturnValue(this.imageHeight.bind(this), 'DoubleRegister', ['StringRegister'], true), + ]); + } + } + + // module.exports = {OBCanvas2D}; + export { OBCanvas2D, Vector2 }; \ No newline at end of file diff --git a/hap/entry/src/main/js/default/common/common.css b/hap/entry/src/main/js/MainAbility/common/common.css similarity index 100% rename from hap/entry/src/main/js/default/common/common.css rename to hap/entry/src/main/js/MainAbility/common/common.css diff --git a/hap/entry/src/main/js/default/common/component/ob_dynamic.hml b/hap/entry/src/main/js/MainAbility/common/component/ob_dynamic.hml similarity index 100% rename from hap/entry/src/main/js/default/common/component/ob_dynamic.hml rename to hap/entry/src/main/js/MainAbility/common/component/ob_dynamic.hml diff --git a/hap/entry/src/main/js/default/common/component/ob_dynamic.js b/hap/entry/src/main/js/MainAbility/common/component/ob_dynamic.js similarity index 51% rename from hap/entry/src/main/js/default/common/component/ob_dynamic.js rename to hap/entry/src/main/js/MainAbility/common/component/ob_dynamic.js index 19f1cef2d67835ee04a445071a449e6b23e0b580..1eeca36a277d64c74480710c38f2760c8274773a 100644 --- a/hap/entry/src/main/js/default/common/component/ob_dynamic.js +++ b/hap/entry/src/main/js/MainAbility/common/component/ob_dynamic.js @@ -1,4 +1,9 @@ - +/** + * @license + * Copyright 2021 Du Tian Wei + * SPDX-License-Identifier: Apache-2.0 + */ + export default { props: { title: { diff --git a/hap/entry/src/main/js/default/common/normalize.css b/hap/entry/src/main/js/MainAbility/common/normalize.css similarity index 100% rename from hap/entry/src/main/js/default/common/normalize.css rename to hap/entry/src/main/js/MainAbility/common/normalize.css diff --git a/hap/entry/src/main/js/MainAbility/common/runtime/debugger.js b/hap/entry/src/main/js/MainAbility/common/runtime/debugger.js new file mode 100644 index 0000000000000000000000000000000000000000..a56d3037c3c163e11b987d6843e3074b17f48e72 --- /dev/null +++ b/hap/entry/src/main/js/MainAbility/common/runtime/debugger.js @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020-2021 Du Tian Wei + * 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. + */ \ No newline at end of file diff --git a/hap/entry/src/main/js/default/app.js b/hap/entry/src/main/js/MainAbility/common/runtime/util.js similarity index 72% rename from hap/entry/src/main/js/default/app.js rename to hap/entry/src/main/js/MainAbility/common/runtime/util.js index 8e47afff13e928a74fdcc01a108e4422404b9ac9..9a7c7770606889f588f06669201f29553685956e 100644 --- a/hap/entry/src/main/js/default/app.js +++ b/hap/entry/src/main/js/MainAbility/common/runtime/util.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2020-2021 Du Tian Wei * 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 @@ -12,12 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; +import util from '@ohos.util' +let _TextDecoder = util.TextDecoder; +export { _TextDecoder as TextDecoder }; \ No newline at end of file diff --git a/hap/entry/src/main/js/default/common/runtime/vm.js b/hap/entry/src/main/js/MainAbility/common/runtime/vm.js similarity index 80% rename from hap/entry/src/main/js/default/common/runtime/vm.js rename to hap/entry/src/main/js/MainAbility/common/runtime/vm.js index d7feb82a9e0cd20e36a3e4581fc841574d212aac..4589daf800c3fbdb08b2bf2a533c77413e2790db 100644 --- a/hap/entry/src/main/js/default/common/runtime/vm.js +++ b/hap/entry/src/main/js/MainAbility/common/runtime/vm.js @@ -3,8 +3,11 @@ * Copyright 2021 Du Tian Wei * SPDX-License-Identifier: Apache-2.0 */ + "use strict" import * as util from './util.js' - export class NativeUtil { + // const util = require('./util.mjs'); + + class NativeUtil { static fieldSetter(target, fieldName, register) { return (builder, args) => { @@ -18,35 +21,53 @@ } static fieldGetter(target, fieldName, register) { return (builder, args) => { - builder[register][args[1] & 0xfff] = (st, f, local) => { + builder[register][args[0] & 0xfff] = (st, f, local) => { return target[fieldName]; }; }; } + static objFieldGetter(fieldName, fieldRegister) { + return (builder, args) => { + let obj = builder.NObjectRegister[args[1] & 0xfff]; + builder[fieldRegister][args[0] & 0xfff] = (st, f, local) => { + return obj(st, f, local)[fieldName]; + }; + }; + } /** - * - * @param {Function} func - * @param {Number[]} argtype - * @returns + * + * @param {Function} func + * @param {Number[]} argtype + * @param {Boolean} addVMarg + * @returns */ - static closureVoid(func, argtype) { + static closureVoid(func, argtype, addVMarg) { /** - * - * @param {OBFunctionBuilder} builder - * @param {Number[]} args - * @returns + * + * @param {OBFunctionBuilder} builder + * @param {Number[]} args + * @returns */ let f = (builder, args) => { args = args.slice(1); let argGetters = argtype.map((rtype, idx) => { let idx1 = args[idx] & 0xFFF; let v = builder[rtype][idx1]; + if (typeof (v) != 'function') { + debugger + } return (st, f, local) => { return v(st, f, local); }; }); builder.PushAction((st, f, local, pos) => { let argVals = argGetters.map(g => g(st, f, local)); + if (addVMarg) { + argVals.push(st); + argVals.push(f); + argVals.push(local); + argVals.push(pos); + } func.apply(null, argVals); return pos + 1; }); @@ -54,17 +75,17 @@ return f; } /** - * - * @param {Function} func - * @param {Number[]} argtype - * @returns + * + * @param {Function} func + * @param {Number[]} argtype + * @returns */ - static closureReturnValue(func, retRegisterType, argtype) { + static closureReturnValue(func, retRegisterType, argtype, addVMarg) { /** - * - * @param {OBFunctionBuilder} builder - * @param {Number[]} args - * @returns + * + * @param {OBFunctionBuilder} builder + * @param {Number[]} args + * @returns */ let f = (builder, args) => { let retRegIdx = args[0]; @@ -80,27 +101,34 @@ }); builder[retRegisterType][retRegIdx] = ((st, f, local) => { let argVals = argGetters.map(g => g(st, f, local)); + if (addVMarg) { + argVals.push(st); + argVals.push(f); + argVals.push(local); + } return func.apply(null, argVals); }); }; return f; } } - export class OBScript { - NativeLibHash = {}; // libname->hash - InstalledLibs = {}; - NativeUtil = NativeUtil; - /** - * @type {StructData} - */ - StructData = {}; //typename->OBStructValueData - /** - * @type {Object.} - */ - StructDef = {}; // typename-> def - loadedFunctions; //= {};//function sign->function - FullNameFSMData = {}; //FullName->OBFSM + class OBScript { + constructor() { + this.NativeLibHash = {}; // libname->hash + this.InstalledLibs = {}; + this.NativeUtil = NativeUtil; + /** + * @1type {StructData} + */ + this.StructData = {}; //typename->OBStructValueData + /** + * @type {Object.} + */ + this.StructDef = {}; // typename-> def + this.loadedFunctions; //= {};//function sign->function + this.FullNameFSMData = {}; //FullName->OBFSM + } /** * @callback FuncInstaller * @param {OBFunctionBuilder} funcBuilder @@ -122,7 +150,7 @@ /** * * @param {string} libname - * @param {integer} funcIdx + * @param {number} funcIdx */ getNativeFunc(libname, funcIdx) { if (funcIdx < 0) { @@ -141,95 +169,103 @@ } } } - export class OBStructDef { - Name; //string - StructCnt; // int - StringCnt; // int - IntegerCnt; // int - FloatCnt; // int - NobjectCnt; // int - StructFields; // int + class OBStructDef { + constructor() { + + this.Name; //string + this.StructCnt; // int + this.StringCnt; // int + this.IntegerCnt; // int + this.FloatCnt; // int + this.NobjectCnt; // int + this.StructFields; // int + } } - export class OBStructValueData { - /** - * @type {OBArrayBufferReader} - */ - Data; //arraybuffer - FullName; - Offset; - Length; - StructCount; + class OBStructValueData { + // /** + // * @type {OBArrayBufferReader} + // */ + // Data; //arraybuffer + // FullName; + // Offset; + // Length; + // StructCount; } - export class OBVariableInfo { - typeIdx; - count; + class OBVariableInfo { + // typeIdx; + // count; constructor(typeIdx, count) { this.typeIdx = typeIdx; this.count = count; } } - export class OBState { - /** - * @type {OBVariableInfo[]} - */ - Variables; - /** - * @type {string} - */ - Name; - MessageHandlers; - EventHandlers; + class OBState { + // /** + // * @type {OBVariableInfo[]} + // */ + // Variables; + // /** + // * @type {string} + // */ + // Name; + // MessageHandlers; + // EventHandlers; } - export class OBCodeSegment { - name; - functions; - fsms; + class OBCodeSegment { + // name; + // functions; + // fsms; } - export class OBFunction { - /** - * @type {OBVariableInfo[]} - */ - Variables; - instructions; - /** - * @type {String} - */ - Signure; + class OBFunction { + // /** + // * @type {OBVariableInfo[]} + // */ + // Variables; + // instructions; + // /** + // * @type {String} + // */ + // Signure; + // Statements; } - export class OBFSM { - /** - * @type {string} - */ - Name; - /** - * @type {Object.} - */ - States; //string->state - /** - * @type {OBState} - */ - Entry; //state - /** - * @type {OBVariableInfo[]} - */ - Variables; - /** - * @type {string} - */ - FullName; + class OBFSM { + // /** + // * @type {string} + // */ + // Name; + // /** + // * @type {Object.} + // */ + // States; //string->state + // /** + // * @type {OBState} + // */ + // Entry; //state + // /** + // * @type {OBVariableInfo[]} + // */ + // Variables; + // /** + // * @type {string} + // */ + // FullName; + // /** + // * @type {string} + // */ + // ModuleName; } - export class OBMessageHandler { - Name; - Func; - ArgTypeName; + class OBMessageHandler { + // Name; + // Func; + // ArgTypeName; } - export class OBEventHandler { - Name; - Func; + class OBEventHandler { + // Name; + // Func; } - export class OBInstruction { - Position; + class OBInstruction { + // Position; /** * * @param {number} code @@ -250,7 +286,7 @@ } } - export class OBByteCodes { + class OBByteCodes { static createInstruction(cmd) { switch (cmd) { //case 0: @@ -270,9 +306,9 @@ case 7: return new RET(); case 8: - return new STMT_start(); + throw Error("Unknown byte code command:" + cmd); case 9: - return new B_STMT_end(); + throw Error("Unknown byte code command:" + cmd); case 10: return new CHSTT(); case 11: @@ -286,7 +322,7 @@ case 15: return new MethodCall(); case 16: - return new MethodCallRegisterInfoAnchor(); + return new ExtInfo(); case 17: return new CreateFSM(); case 18: @@ -371,87 +407,87 @@ return new LNOT(); case 58: return new COND(); + case 59: + return new NEW(); + case 60: + return new CSTR(); default: throw Error("Unknown byte code command:" + cmd); } // return new OBInstruction(cmd); } } - export class PositionUpdatePair { - targetOffset; - callback; + class PositionUpdatePair { + // targetOffset; + // callback; } - export class OBFunctionBuilder { - loader; //OBScriptLoader - StatementLength; //integer - BuildingFunc; //OBFunction - PositionUpdatePairList; - currentInstructPosition; //integer - CurrentStatementStack = []; //[StatementContext] - - /** - * @callback LongRegister - * @param {OBVMState} - * @param {OBFunctionBuilder} - * @param {OBInstruction[]} - * @param {number} - * @returns {number} - */ - /** - * @type LongRegister[] - */ - LongRegister; - /** - * @callback DoubleRegister - * @param {OBVMState} - * @param {OBFunctionBuilder} - * @param {OBInstruction[]} - * @param {number} - * @returns {number} - */ - /** - * @type DoubleRegister[] - */ - DoubleRegister; - /** - * @callback StringRegister - * @param {OBVMState} - * @param {OBFunctionBuilder} - * @param {OBInstruction[]} - * @param {number} - * @returns {string} - */ - /** - * @type StringRegister[] - */ - StringRegister; - /** - * @callback StringRegister - * @param {OBVMState} - * @param {OBFunctionBuilder} - * @param {OBInstruction[]} - * @param {number} - * @returns {OBStructValue} - */ - /** - * @type StructRegister[] - */ - StructRegister; - /** - * @callback StringRegister - * @param {OBVMState} - * @param {OBFunctionBuilder} - * @param {OBInstruction[]} - * @param {number} - * @returns {object} - */ - /** - * @type NObjectRegister[] - */ - NObjectRegister; + class OBFunctionBuilder { + // loader; //OBScriptLoader + // StatementLength; //integer + // BuildingFunc; //OBFunction + // PositionUpdatePairList; + // currentInstructPosition; //integer + // RootStatementContext = new OBStatementContext(); //[StatementContext] + + // /** + // * @callback LongRegister + // * @param {OBVMState} + // * @param {OBFunctionBuilder} + // * @param {OBInstruction[]} + // * @returns {number} + // */ + // /** + // * @type LongRegister[] + // */ + // LongRegister; + // /** + // * @callback DoubleRegister + // * @param {OBVMState} + // * @param {OBFunctionBuilder} + // * @param {OBInstruction[]} + // * @returns {number} + // */ + // /** + // * @type DoubleRegister[] + // */ + // DoubleRegister; + // /** + // * @callback StringRegister + // * @param {OBVMState} + // * @param {OBFunctionBuilder} + // * @param {OBInstruction[]} + // * @returns {string} + // */ + // /** + // * @type StringRegister[] + // */ + // StringRegister; + // /*@ + // * @callback StringRegister + // * @param {OBVMState} + // * @param {OBFunctionBuilder} + // * @param {OBInstruction[]} + // * @returns {OBStructValue} + // */ + // /** + // * @type {Array} StructRegister[] + // */ + // StructRegister; + // /*@ + // * @callback StringRegister + // * @param {OBVMState} + // * @param {OBFunctionBuilder} + // * @param {OBInstruction[]} + // * @returns {object} + // */ + // /** + // * @type {Array} NObjectRegister[] + // */ + // NObjectRegister; constructor(loader) { this.loader = loader; + this.RootStatementContext = new OBStatementContext(); //[StatementContext] } loadFunctionHeader(reader) { @@ -461,7 +497,7 @@ let header = reader.ReadUInt32(); let pos = reader.pos; - this.StatementLength = header * 4 - pos; + // this.StatementLength = header * 4 - pos; reader.pos = header * 4; let nameIdx = reader.ReadUInt32(); BuildingFunc.Signure = data.GetString(nameIdx); @@ -480,13 +516,15 @@ let info = new OBVariableInfo(); info.typeIdx = i; info.count = reader.ReadUInt32(); + varInfo[i] = info; } + this.StatementLength = reader.ReadUInt32(); BuildingFunc.Variables = varInfo; reader.pos = pos; } loadStatement(reader) { - let length = this.StatementLength / 4; + let length = this.StatementLength; this.BuildingFunc.instructions = []; this.PositionUpdatePairList = []; //[PositionUpdatePair] for (let i = 0; i < length; i++) { @@ -526,21 +564,21 @@ } PushAction(Instruction) { - let stmt = this.CurrentStatementStack[this.CurrentStatementStack.length - 1]; + let stmt = this.RootStatementContext; let newPos = stmt.Actions.length; stmt.PushAction(Instruction); this.PositionUpdatePairList.forEach((p) => { - if (p.targetOffset == this.currentInstructPosition) { + if (p.targetOffset === this.currentInstructPosition) { p.callback(newPos); } }); } } - export class OBBuildInFunctions { + class OBBuildInFunctions { /** - * - * @param {OBScript} script + * + * @param {OBScript} script */ static install(script) { script.InstallLib("", "", [ @@ -562,9 +600,9 @@ ]); } /** - * - * @param {String} str - * @returns + * + * @param {String} str + * @returns */ static Text_Reverse(str) { if (str) { @@ -586,9 +624,9 @@ } } /** - * - * @param {String} str - * @returns + * + * @param {String} str + * @returns */ static Text_ToTitleCase(str) { return str.replace( @@ -599,9 +637,9 @@ ); } /** - * - * @param {String} str - * @returns + * + * @param {String} str + * @returns */ static Text_ToLowerCase(str) { if (str) { @@ -610,9 +648,9 @@ return ""; } /** - * - * @param {String} str - * @returns + * + * @param {String} str + * @returns */ static Text_ToUpperCase(str) { if (str) { @@ -652,7 +690,7 @@ } } static Text_IndexOf(str, sub, forward) { - if (forward == 1) { + if (forward === 1) { return str.indexOf(sub) + 1; } else { return str.lastIndexOf(sub) + 1; @@ -683,7 +721,12 @@ let a2 = builder.StringRegister[typeIdx]; let StructData = builder.loader.script.StructData; builder.StructRegister[returnRegisterIdx] = (state, func, locals) => { - let r = StructData.Get(a2(state, func, locals), a1(state, func, locals)); + let typename = a2(state, func, locals); + let id = a1(state, func, locals); + let r = StructData.Get(typename, id); + if (!r) { + throw `Can't find ${typename} which id is ${id}`; + } return r; }; } @@ -694,25 +737,25 @@ }; } } - export class OBStructValue { - /** - * @type {OBStructDef} - */ - Def; - /** - * @type {OBTypedVariableGroup} - */ - registers; + class OBStructValue { + // /** + // * @type {OBStructDef} + // */ + // Def; + // /** + // * @type {OBTypedVariableGroup} + // */ + // registers; constructor(Def) { this.Def = Def; - let registers = new OBTypedVariableGroup(); + let registers = new OBTypedVariableGroup(null); registers.LongRegister = []; - registers.LongRegister.length = Def.IntegerCnt; + registers.LongRegister.fill(0, 0, Def.IntegerCnt); registers.DoubleRegister = []; - registers.DoubleRegister.length = Def.FloatCnt; + registers.DoubleRegister.fill(0, 0, Def.FloatCnt); registers.StringRegister = []; - registers.StringRegister.length = Def.StringCnt; + registers.StringRegister.fill('', 0, Def.StringCnt); registers.StructRegister = []; registers.StructRegister.length = Def.StructCnt; registers.NObjectRegister = []; @@ -724,19 +767,19 @@ return "Struct." + this.Def.Name; } } - export class StructData { - /** - * @type {Object.} - */ - StructDef; - /** - * @type {Object.} - */ - Groups; - /** - * @type {OBArrayBufferReader} - */ - DataSegment; + class StructData { + // /** + // * @type {Object.} + // */ + // StructDef; + // /** + // * @type {Object.} + // */ + // Groups; + // /** + // * @type {OBArrayBufferReader} + // */ + // DataSegment; constructor(structDataGroups, data) { this.Groups = structDataGroups; @@ -745,7 +788,7 @@ /** * * @param {string} type fullname of type - * @param {integer} id id of data + * @1param {integer} id id of data * @param {?Object.} * @returns {OBStructValue} */ @@ -763,13 +806,16 @@ } let def = this.StructDef[type]; let group = this.Groups[type]; + if (!group) { + throw `There is no preset data of the type ${type}`; + } let reader = group.Data; let itemStart = 0; for (let i = 0; i < group.StructCount; i++) { reader.pos = itemStart; let length = reader.ReadInt32(); let itemid = reader.ReadUInt32(); - if (itemid == id) { + if (itemid === id) { reader.pos -= 4; let s = new OBStructValue(def); loading[id + "@" + type] = s; @@ -815,10 +861,10 @@ } } - export class OBStructDataReader { + class OBStructDataReader { /** - * - * @param {OBArrayBufferReader} reader + * + * @param {OBArrayBufferReader} reader * @returns {StructData} */ readStream(reader) { @@ -827,13 +873,13 @@ return this.readStructData(reader, data); } /** - * - * @param {OBArrayBufferReader} reader - * @param {OBArrayBubberReader} data + * + * @param {OBArrayBufferReader} reader + * @param {OBArrayBufferReader} data * @returns {StructData} */ readStructData(reader, data) { - let length = reader.ReadInt32(); + let _length = reader.ReadInt32(); let structs = {}; let groupCnt = reader.ReadUInt32(); @@ -857,26 +903,28 @@ } } class Relocation { - /** - * @type {Object.} - */ - string = {}; - /** - * @type {Object.} - */ - integer = {}; - /** - * @type {Object.} - */ - float = {}; - /** - * @type {Object.} - */ - bin = {}; - /** - * @type {Object.} - */ - structFieldIndex = {}; + constructor() { + /** + * @1type {Object.:{idx:Number,inited:bool}>} + */ + this.string = {}; + /** + * @1type {Object.} + */ + this.integer = {}; + /** + * @1type {Object.} + */ + this.float = {}; + /** + * @1type {Object.} + */ + this.bin = {}; + /** + * @1type {Object.} + */ + this.structFieldIndex = {}; + } addRelocationString(str) { if ((typeof str) !== 'string') { @@ -890,95 +938,19 @@ } } } - export class OBStructDataSerializer { - relocation = new Relocation(); - /** - * - * @param {OBStructValue[]} valueData - * @returns {int[]} - */ - serialize(valueDataArray) { - let group = this.groupData(valueDataArray); - } - /** - * - * @param {OBStructValue[]} valueDataArray - * @returns {Object. { - let list = group[d.Def.Name]; - if (!list) { - list = []; - group[d.Def.Name] = list; - } - this.collData(d); - list.push(d); - }); - return group; - } - /** - * - * @param {OBStructValue} d - */ - collData(d) { - d.string.forEach(str => { - this.relocation.addRelocationString(str); - }); - d.registers.object.forEach(ofd => { - switch (ofd.type.$__type) { - case "StructFieldTypeStruct": - break; - case "StructFieldTypeIntegerMap": - switch (ofd.type.elementType.name) { - case 'string': - case 'String': - Object.values(item.registers.object[ofd.registerIndex]).forEach(str => { - this.addRelocationString(str); - }); - } - break; - case "StructFieldTypeStringMap": - switch (ofd.type.elementType.name) { - case 'string': - case 'String': - Object.values(item.registers.object[ofd.registerIndex]).forEach(str => { - this.addRelocationString(str); - }); - } - Object.keys(item.registers.object[ofd.registerIndex]).forEach(str => { - this.addRelocationString(str); - }); - break; - case "StructFieldTypeList": - switch (ofd.type.elementType.name) { - case 'string': - case 'String': - Object.values(item.registers.object[ofd.registerIndex]).forEach(str => { - this.addRelocationString(str); - }); - } - break; - default: - console.error(ofd); - throw Error("功能未实现 " + ofd.type.$__type); - } - }); + class OBScriptLoader { + constructor() { + // /** + // * @type {OBArrayBufferReader} + // */ + // reader; //OBArrayBufferReader + // /** + // * @type {OBArrayBufferReader} + // */ + // data; //OBArrayBufferReader + this.loadingFunctions = {}; //[OBFunctionBuilder] + this.Linkings = []; //Linkable } - } - export class OBScriptLoader { - /** - * @type {OBArrayBufferReader} - */ - reader; //OBArrayBufferReader - /** - * @type {OBArrayBufferReader} - */ - data; //OBArrayBufferReader - loadingFunctions = {}; //[OBFunctionBuilder] - Linkings = []; //Linkable - /** * @callback NativeLibInstaller * @param {OBScript} script @@ -1017,18 +989,18 @@ if (MAG != 0x5845557F) { throw Error("Unknown MAG:" + MAG); } - let version = this.reader.ReadInt32(); + let version = this.reader.ReadUInt32(); if (version != 1) { throw Error("Unsupported version." + version); } - let SegmentCnt = this.reader.ReadInt32(); + let SegmentCnt = this.reader.ReadUInt32(); let headerEnd = this.reader.pos + SegmentCnt * 2 * 4; let codes = []; for (let i = 0; i < SegmentCnt; i++) { - let type = this.reader.ReadInt32(); + let type = this.reader.ReadUInt32(); let startIn4Bytes = this.reader.ReadUInt32(); let start = headerEnd + startIn4Bytes * 4; let pos = this.reader.pos; @@ -1056,7 +1028,7 @@ this.loadPackageInfo(); break; default: - throw new FileLoadException("Unknown Segment type:" + type); + throw Error("Unknown Segment type:" + type); } this.reader.seek(pos); } @@ -1078,7 +1050,7 @@ let start = reader.pos; let SegmentReader = reader.getSub(start); - + let length = SegmentReader.ReadUInt32(); let header = SegmentReader.ReadUInt32() * 4; SegmentReader.pos = header; let segment = new OBCodeSegment(); @@ -1126,7 +1098,7 @@ for (let i = 0; i < states.length; i++) { let s = states[i]; stateDict[s.Name] = s; - if (entryStateName == s.Name) { + if (entryStateName === s.Name) { entryState = s; } } @@ -1252,8 +1224,11 @@ } readVariable(reader) { - let typeIdx = reader.ReadInt32(); - let count = reader.ReadInt32(); + // let typeIdx = reader.ReadUInt32(); + // let count = reader.ReadInt32(); + let vari = reader.ReadUInt32(); + let count = vari & 0xFFFFFFF; + let typeIdx = vari >> 28; let v = new OBVariableInfo(typeIdx, count); return v; } @@ -1298,9 +1273,9 @@ loadStructDefDataSegment() { let reader = this.reader; let data = this.data; - let length = reader.ReadInt32(); + let length = reader.ReadUInt32(); let d = {}; - let cnt = reader.ReadInt32(); + let cnt = reader.ReadUInt32(); for (let i = 0; i < cnt; i++) { let nameIdx = reader.ReadUInt32(); let name = data.GetString(nameIdx); @@ -1331,19 +1306,19 @@ } loadDataSegment() { - let length = this.reader.ReadInt32(); + let length = this.reader.ReadUInt32(); return this.reader.readSub(length * 4); } loadPackageInfo() { let reader = this.reader; let data = this.data; - let depCnt = reader.ReadInt32(); + let depCnt = reader.ReadUInt32(); let err = []; for (let i = 0; i < depCnt; i++) { - let nameIdx = reader.ReadInt32(); + let nameIdx = reader.ReadUInt32(); let name = data.GetString(nameIdx); - let hashIdx = reader.ReadInt32(); + let hashIdx = reader.ReadUInt32(); let hash = data.GetString(hashIdx); let lhash = this.script.NativeLibHash[name]; if (!lhash) { @@ -1359,28 +1334,34 @@ } } - export class OBArrayBufferReader { - /** - * @type {Number} integer of position - */ - pos; // int - /** - * @type {ArrayBuffer} - */ - buf; // ArrayBuffer - /** - * @type DataView - */ - view; // DataView - /** - * @type {Object.} - */ - stringCache = {}; + class OBArrayBufferReader { + // /** + // * @type {Number} integer of position + // */ + // pos; // int + // /** + // * @type {Number} integer of start + // */ + // start; // int + // /** + // * @type {ArrayBuffer} + // */ + // buf; // ArrayBuffer + // /** + // * @type DataView + // */ + // view; // DataView + // /** + // * @type {Object.} + // */ + // stringCache = {}; constructor(buf) { this.buf = buf; this.pos = 0; + this.start = 0; this.view = new DataView(buf); + this.stringCache = {}; } ReadInt32() { @@ -1390,18 +1371,20 @@ } getInt32(p) { - let v = this.view.getInt32(p, true); + let v = this.view.getInt32(this.start + p, true); + // let v = this.view.getInt32(p, true); return v; } ReadUInt32() { - let v = this.getUint32(this.pos, true); + let v = this.getUint32(this.pos); this.pos += 4; return v; } getUint32(p) { - let v = this.view.getUint32(p, true); + let v = this.view.getUint32(this.start + p, true); + // let v = this.view.getUint32(p, true); return v; } @@ -1411,25 +1394,33 @@ } getFloat(p) { - let v = this.view.getFloat32(p, true); + let v = this.view.getFloat32(this.start + p, true); + // let v = this.view.getFloat32(p, true); return v; } GetString(stringIdx) { + let str = this.stringCache[stringIdx]; + if (str) { + return str; + } let start = stringIdx * 8; // 字符串是8字节对齐 - let length = this.view.getUint32(start, true); - if (length == 0) { + let length = this.view.getUint32(this.start + start, true); + if (length === 0) { return ""; } - let ab = this.buf.slice(start + 4, start + 4 + length); + start = this.start + start + 4; + // start = start + 4; + let ab = this.buf.slice(start, start + length); let ui8 = new Uint8Array(ab); let utf8decoder = new util.TextDecoder("utf-8", { fatal: true }); - let str = utf8decoder.decode(ui8); - if (str == null) { + str = utf8decoder.decode(ui8); + if (str === null) { throw Error('no string value of idx:' + stringIdx); } + this.stringCache[stringIdx] = str; return str; } @@ -1440,17 +1431,22 @@ } getSub(pos, length) { - let buf; - if (typeof (length) == "undefined") { - buf = this.buf.slice(pos); - } else { - buf = this.buf.slice(pos, pos + length); - } - return new OBArrayBufferReader(buf); + // let buf; + // if (typeof (length) === "undefined") { + // buf = this.buf.slice(pos); + // } else { + // buf = this.buf.slice(pos, pos + length); + // } + // let reader = new OBArrayBufferReader(buf); + // reader.start = this.start + pos; + // return reader; + let reader = new OBArrayBufferReader(this.buf); + reader.start = this.start + pos; + return reader; } seek(pos) { - if (typeof (pos) == "number") { + if (typeof (pos) === "number") { this.pos = pos; } return this.pos; @@ -1476,49 +1472,59 @@ } - export class OBStatementContext { - InstPos; - Actions = []; - + class OBStatementContext { + constructor() { + // this.InstPos; + this.Actions = []; + } PushAction(Instruction) { this.Actions.push(Instruction); } } // 虚拟机 - export class VMInterruptException { + class VMInterruptException { } - export class ChangeStateException extends VMInterruptException { + class ChangeStateException extends VMInterruptException { } - export class ChangeDestroyException extends VMInterruptException { + class ChangeDestroyException extends VMInterruptException { } - export class OBVM { - /** - * @type {function(any)} - */ - Output; - /** - * typeName->[VMFSM] - * @type {Object.} - */ - Running = {}; - /** - * @type OBScript - */ - script; - /** - * @type {OBVMFSM} - */ - Pending = []; + class OBVM { + // /** + // * @1type {function(any)} + // */ + // Output; + // setTimeout; + // /** + // * typeName->[VMFSM] + // * @1type {Object.} + // */ + // Running = {}; + // /** + // * @type OBScript + // */ + // script; + // /** + // * @1type {OBVMFSM} + // */ + // Pending = []; /** * * @param {OBScript} script */ - constructor(script) { + constructor(script, config) { + this.Running = {}; + this.Pending = []; if (!script) { throw Error("Script is null"); } this.script = script; + if (config) { + Object.assign(this, config); + } + if (!this.setTimeout) { + this.setTimeout = setTimeout.bind(window); + } } CreateFSM(name) { @@ -1544,7 +1550,7 @@ update() { this._HandleOnePendingFSM(); - let timestamp = Date.now(); + // let timestamp = Date.now(); // JS不需要在VM中处理计划任务 // this._HandleSchedulingTask(timestamp); // this._InvokeScheduledTask(timestamp); @@ -1580,7 +1586,7 @@ let name = fsm.data.FullName; let list = this.Running[name]; if (list) { - let idx = list.findIndex((f) => f == fsm); + let idx = list.findIndex((f) => f === fsm); if (idx > -1) { list.splice(idx, 1); } @@ -1603,54 +1609,59 @@ /** * * @param {number} millisecond wait time - * @param {OBVMAction} callback + * @param {*} callback */ Schedule(millisecond, callback) { - setTimeout(callback, millisecond, this); + this.setTimeout(callback, millisecond, this); } FindRunningFSMByType(typeFullName) { return this.Running[typeFullName] || []; } } - export class OBVMFSM { - static ID_GEN = 0; - /** - * @type {any} - */ - Target; - /** - * @type {OBFSM} - */ - data; - id; - /** - * @type {OBVMState} - */ - CurrentState; - /** - * @type {OBVMState[]} - */ - StateStack = []; - /** - * @type {OBVM} - */ - VM; - Inbox = []; - PrioritizedInbox = []; - VariableGroup; + let ID_GEN = 0; + class OBVMFSM { + // /** + // * @type {any} + // */ + // Target; + // /** + // * @type {OBFSM} + // */ + // data; + // id; + // /** + // * @type {OBVMState} + // */ + // CurrentState; + // /** + // * @type {OBVMState[]} + // */ + // StateStack = []; + // /** + // * @type {OBVM} + // */ + // VM; + // Inbox = []; + // PrioritizedInbox = []; + // VariableGroup; /** * * @param {OBVM} vm * @param {OBFSM} data */ constructor(vm, data) { + this.Running = true; + this.OnDestroyedCallbacks = []; + this.StateStack = []; + this.Inbox = []; + this.PrioritizedInbox = []; this.data = data; - this.id = ++OBVMFSM.ID_GEN; + this.id = ++ID_GEN; this.VM = vm; this.VariableGroup = new OBTypedVariableGroup(data.Variables); this.CurrentState = new OBVMState(data.Entry, this); - this.PostPrioritizedMessage(new OBEventMessage("Start", "", null)); + this.PostPrioritizedMessage(new OBEventMessage("Start", "", null, null)); } /** * 推送高优先级消息 @@ -1676,6 +1687,9 @@ } HandleAllMessages() { + if (!this.CurrentState) { + return; + } let msg; while (msg = this.PrioritizedInbox.shift()) { msg.Handle(this.CurrentState); @@ -1688,6 +1702,15 @@ } } + OnDestroyed(f) { + this.OnDestroyedCallbacks.push(f); + } + OffDestroyed(f) { + let idx = this.OnDestroyedCallbacks.indexOf(f); + if (idx >= 0) { + this.OnDestroyedCallbacks.slice(idx, 1); + } + } Destroy() { this.VariableGroup = null; this.CurrentState = null; @@ -1695,6 +1718,10 @@ this.StateStack.length = 0; this.PrioritizedInbox.length = 0; this.VM.DestroyFSM(this); + this.Running = false; + this.OnDestroyedCallbacks.forEach(f => { + f(this); + }); } /** * @@ -1718,16 +1745,16 @@ this.CurrentState = new OBVMState(this.data.States[name], this); this.PostPrioritizedMessage(new OBEventMessage("Start", null, null, this)); } else { - throw Error("No state named " + name + " of FSM " + this.Fsmdata.Name); + throw Error("No state named " + name + " of FSM " + this.data.Name); } } } - export class OBTypedVariableGroup { - LongRegister; - DoubleRegister; - StringRegister; - StructRegister; - NObjectRegister; + class OBTypedVariableGroup { + // LongRegister; + // DoubleRegister; + // StringRegister; + // StructRegister; + // NObjectRegister; /** * * @param {OBVariableInfo[]} variables @@ -1740,58 +1767,66 @@ switch (v.typeIdx) { case 0: if (this.LongRegister != null) { - throw Error("duplicated type " + v.TypeIdx); + throw Error("duplicated type " + v.typeIdx); } this.LongRegister = []; + this.LongRegister.length = v.count; + this.LongRegister.fill(0); break; case 1: if (this.DoubleRegister != null) { - throw Error("duplicated type " + v.TypeIdx); + throw Error("duplicated type " + v.typeIdx); } this.DoubleRegister = []; + this.DoubleRegister.length = v.count; + this.DoubleRegister.fill(0); break; case 2: if (this.StringRegister != null) { - throw Error("duplicated type " + v.TypeIdx); + throw Error("duplicated type " + v.typeIdx); } this.StringRegister = []; + this.StringRegister.length = v.count; + this.StringRegister.fill(""); break; case 3: if (this.StructRegister != null) { - throw Error("duplicated type " + v.TypeIdx); + throw Error("duplicated type " + v.typeIdx); } this.StructRegister = []; + this.StructRegister.length = v.count; break; case 4: if (this.NObjectRegister != null) { - throw Error("duplicated type " + v.TypeIdx); + throw Error("duplicated type " + v.typeIdx); } this.NObjectRegister = []; + this.NObjectRegister.length = v.count; break; default: - throw Error("Unknown type " + v.TypeIdx); + throw Error("Unknown type " + v.typeIdx); } }); } } - export class OBVMState { - /** - * @type {OBState} - */ - data; - /** - * @type {OBVMFSM} - */ - fsm; - /** - * @type {TypedVariableGroup} - */ - VariableGroup; - /** - * @type {OBMessage} - */ - currentMessage; + class OBVMState { + // /** + // * @type {OBState} + // */ + // data; + // /** + // * @type {OBVMFSM} + // */ + // fsm; + // /** + // * @type {OBTypedVariableGroup} + // */ + // VariableGroup; + // /** + // * @type {OBMessage} + // */ + // currentMessage; constructor(data, fsm) { this.data = data; @@ -1824,7 +1859,7 @@ let hl = this.data.MessageHandlers[m.name]; if (hl) { hl.forEach(h => { - if (h.ArgTypeName == "" || h.ArgTypeName == typeName) { + if (h.ArgTypeName === "" || h.ArgTypeName === typeName) { new OBVMFunction(h.Func).Call(this); } }); @@ -1858,39 +1893,115 @@ } } } - export class OBVMFunction { - /** - * @type {OBFunction} - */ - data; - /** - * @type {TypedVariableGroup} - */ - LocalVar; - returnType = -1; - returnValue; + class OBVMFunction { + // /** + // * @type {OBFunction} + // */ + // data; + // /** + // * @type {OBTypedVariableGroup} + // */ + // LocalVar; + // returnType = -1; + // returnValue; + // LongRegister; + // DoubleRegister; + // StringRegister; + // StructRegister; + // NObjectRegister; /** * * @param {OBFunction} obfunc */ - constructor(obfunc) { + constructor(obfunc, builder, args) { + this.returnType = -1; this.data = obfunc; let LocalVar = new OBTypedVariableGroup(obfunc.Variables); this.LocalVar = LocalVar; - LocalVar.LongRegister = []; - LocalVar.DoubleRegister = []; - LocalVar.StringRegister = []; - LocalVar.StructRegister = []; - LocalVar.NObjectRegister = []; - for (let i = 0; i < obfunc.StringLocalVariableCount; i++) { - LocalVar.StringRegister[i] = ""; + if (builder) { + /** + * @1type {List>();} + */ + let LongRegister_ = []; + let DoubleRegister_ = [];// new List>(); + let StringRegister_ = [];// new List>(); + let StructRegister_ = [];// new List>(); + let NObjectRegister_ = [];//new List>(); + + for (let i = 1; i < args.length; i++) { + let arg = args[i]; + let Register = arg & 0xFFF; + let RegisterType = (arg >> 12) & 0xF; + + switch (RegisterType) { + case 0: + LongRegister_.push(builder.LongRegister[Register]); + break; + case 1: + DoubleRegister_.push(builder.DoubleRegister[Register]); + break; + case 2: + StringRegister_.push(builder.StringRegister[Register]); + break; + case 3: + StructRegister_.push(builder.StructRegister[Register]); + break; + case 4: + NObjectRegister_.push(builder.NObjectRegister[Register]); + break; + default: + throw Error("Unknown type " + RegisterType); + } + } + if (LongRegister_.length > 0) { + this.LongRegister = LongRegister_; + } + if (DoubleRegister_.length > 0) { + this.DoubleRegister = DoubleRegister_; + } + if (StringRegister_.length > 0) { + this.StringRegister = StringRegister_; + } + if (StructRegister_.length > 0) { + this.StructRegister = StructRegister_; + } + if (NObjectRegister_.length > 0) { + this.NObjectRegister = NObjectRegister_; + } } } /** * * @param {OBVMState} state */ - Call(state) { + Call(state, uBFunction, localVars) { + if (uBFunction) { + if (this.LongRegister != null) { + for (let i = 0; i < this.LongRegister.length; i++) { + this.LocalVar.LongRegister[i] = this.LongRegister[i](state, uBFunction, localVars); + } + } + if (this.DoubleRegister != null) { + for (let i = 0; i < this.DoubleRegister.length; i++) { + this.LocalVar.DoubleRegister[i] = this.DoubleRegister[i](state, uBFunction, localVars); + } + } + if (this.StringRegister != null) { + for (let i = 0; i < this.StringRegister.length; i++) { + this.LocalVar.StringRegister[i] = this.StringRegister[i](state, uBFunction, localVars); + } + } + if (this.StructRegister != null) { + for (let i = 0; i < this.StructRegister.length; i++) { + this.LocalVar.StructRegister[i] = this.StructRegister[i](state, uBFunction, localVars); + } + } + if (this.NObjectRegister != null) { + for (let i = 0; i < this.NObjectRegister.length; i++) { + this.LocalVar.NObjectRegister[i] = this.NObjectRegister[i](state, uBFunction, localVars); + } + } + } let Actions = this.data.Statements.Actions; for (let i = 0; i < Actions.length && i >= 0;) { let action = Actions[i]; @@ -1904,7 +2015,7 @@ } Long() { - if (this.returnType == 1) { + if (this.returnType === 1) { return this.returnValue; } else { @@ -1918,7 +2029,7 @@ } Double() { - if (this.returnType == 2) { + if (this.returnType === 2) { return this.returnValue; } else { @@ -1932,7 +2043,7 @@ } String() { - if (this.returnType == 3) { + if (this.returnType === 3) { return this.returnValue; } else { @@ -1946,7 +2057,7 @@ } Struct() { - if (this.returnType == 4) { + if (this.returnType === 4) { return this.returnValue; } else { @@ -1960,7 +2071,7 @@ } NObject() { - if (this.returnType == 5) { + if (this.returnType === 5) { return this.returnValue; } else { @@ -1968,11 +2079,11 @@ } } } - export class OBMessage { - name; - arg; - argType; - sender; + class OBMessage { + // name; + // arg; + // argType; + // sender; /** * * @param {string} name @@ -2002,24 +2113,32 @@ case 2: return "String"; case 3: - return "Struct"; + return arg.Def.Name; case 4: // return "NObject"; - if (arg.constructor == OBVMFSM) { + if (arg.constructor === OBVMFSM) { return "FSM"; } else { + console.warn("should not get type name of native type"); if (arg.constructor) { return arg.constructor.name; } else { - return typeof (arg); + throw Error('Can not get type name of native type'); } } + // case 4: + // console.warn("should not get type name of native type"); + // if (arg.constructor) { + // return arg.constructor.name; + // }else{ + // throw Error('Can not get type name of native type'); + // } default: throw Error("Unknown type:" + typeId); } } } - export class OBEventMessage extends OBMessage { + class OBEventMessage extends OBMessage { /** * * @param {OBVMState} state @@ -2027,7 +2146,8 @@ Handle(state) { try { state.HandleEvent(this); - } catch (err) { + } + catch (err) { if (!(err instanceof VMInterruptException)) { console.error(err); throw err; @@ -2035,7 +2155,7 @@ } } } - export class OBUserMessage extends OBMessage { + class OBUserMessage extends OBMessage { /** * @@ -2053,39 +2173,14 @@ } } // 字节码 - export class STMT_start extends OBInstruction { - StatementContext; - - init(code, builder, instructions, i) { - this.StatementContext = new OBStatementContext(); - this.StatementContext.InstPos = this.Position; - } - - link(builder, instructions, i) { - if (builder.CurrentStatementStack.length > 0) { - let Actions = null; - builder.PushAction((st, uf, locals, pos) => { - if (Actions == null) { - Actions = this.StatementContext.Actions; - } - for (let i = 0; i < Actions.length;) { - let action = Actions[i]; - i = action(st, uf, locals, i); - } - return pos + 1; - }); - } - builder.CurrentStatementStack.push(this.StatementContext); - } - } - export class LDSTR extends OBInstruction { - Value; - Register; + class LDSTR extends OBInstruction { + // Value; + // Register; init(code, builder, instructions, i) { let stridx = code & 0xFFF; this.Value = builder.loader.data.GetString(stridx); - this.Register = (code & 0xFFF000) >> 12; + this.Register = (code & 0xFF0000) >> 16; } link(builder, instructions, idx) { @@ -2096,9 +2191,9 @@ return this.Value; } } - export class PRT extends OBInstruction { - RegisterType; - RegisterIdx; + class PRT extends OBInstruction { + // RegisterType; + // RegisterIdx; init(code, builder, instructions, i) { this.RegisterType = (code & 0xF00000) >> 20; @@ -2135,20 +2230,9 @@ }); } } - export class B_STMT_end extends OBInstruction { - link(builder, instructions, idx) { - builder.PushAction((st, uf, locals, pos) => { - return pos + 1; - }); - let sc = builder.CurrentStatementStack.pop(); - if (builder.CurrentStatementStack.length == 0) { - builder.RootStatementContext = sc; - } - } - } - export class ReceivedMessage extends OBInstruction { - typeId; - Register; + class ReceivedMessage extends OBInstruction { + // typeId; + // Register; init(code, builder, instructions, i) { this.typeId = (code >> 20) & 0xf; @@ -2188,10 +2272,10 @@ } } } - export class STVS extends OBInstruction { - Register; - VarIdx; - RegisterType; + class STVS extends OBInstruction { + // Register; + // VarIdx; + // RegisterType; init(code, builder, instructions, i) { this.Register = (code & 0xFF00) >> 8; @@ -2248,10 +2332,10 @@ } } } - export class STVG extends OBInstruction { - Register; - VarIdx; - RegisterType; + class STVG extends OBInstruction { + // Register; + // VarIdx; + // RegisterType; init(code, builder, instructions, i) { this.Register = (code & 0xFF00) >> 8; @@ -2293,20 +2377,20 @@ } } } - export class StructFieldDesc extends OBInstruction { - fieldTypeId; - fieldDescIdx; + class StructFieldDesc extends OBInstruction { + // fieldTypeId; + // fieldDescIdx; init(code, builder, instructions, i) { this.fieldDescIdx = code & 0xfffff; this.fieldTypeId = (code >> 20) & 0xf; } } - export class GetStructField extends OBInstruction { - structIdx; - Register; - typeId; - fieldIdx; + class GetStructField extends OBInstruction { + // structIdx; + // Register; + // typeId; + // fieldIdx; init(code, builder, instructions, i) { let desc = instructions[i - 1]; @@ -2357,11 +2441,11 @@ } } - export class SetStructField extends OBInstruction { - structIdx; - Register; - typeId; - fieldIdx; + class SetStructField extends OBInstruction { + // structIdx; + // Register; + // typeId; + // fieldIdx; init(code, builder, instructions, i) { let desc = instructions[i - 1]; @@ -2420,8 +2504,8 @@ } } - export class CHSTT extends OBInstruction { - StateName; + class CHSTT extends OBInstruction { + // StateName; init(code, builder, instructions, i) { let strIdx = (code & 0xFFFFFF); @@ -2437,15 +2521,15 @@ }); } } - export class MethodCallRegisterInfoAnchor extends OBInstruction { - RegisterInfoIdx; + class ExtInfo extends OBInstruction { + // RegisterInfoIdx; init(code, builder, instructions, i) { - this.RegisterInfoIdx = code & 0xFFFF; + this.info = code & 0xFFFF; } } - export class NativeMethodCall extends OBInstruction { - LibNameIdx; + class NativeMethodCall extends OBInstruction { + // LibNameIdx; init(code, builder, instructions, i) { this.LibNameIdx = code & 0xFFFFFF; @@ -2454,10 +2538,10 @@ link(builder, instructions, idx) { let LibName = builder.loader.data.GetString(this.LibNameIdx); let anchor = instructions[idx - 1]; - if (!(anchor instanceof MethodCallRegisterInfoAnchor)) { - throw Error("last cmd is not MethodCallRegisterInfoAnchor"); + if (!(anchor instanceof ExtInfo)) { + throw Error("last cmd is not ExtInfo"); } - let RegisterInfoIdx = anchor.RegisterInfoIdx; + let RegisterInfoIdx = anchor.info; let args = builder.loader.data.GetInt32FromBin(RegisterInfoIdx); let funcIdx = args[0]; let _args = args.slice(1); @@ -2465,10 +2549,10 @@ installer(builder, _args); } } - export class FSMVS extends OBInstruction { - Register; - VarIdx; - RegisterType; + class FSMVS extends OBInstruction { + // Register; + // VarIdx; + // RegisterType; init(code, builder, instructions, i) { this.Register = (code & 0xFF00) >> 8; @@ -2521,8 +2605,8 @@ } } } - export class SLF extends OBInstruction { - RegisterIdx; + class SLF extends OBInstruction { + // RegisterIdx; init(code, builder, instructions, i) { this.RegisterIdx = code & 0xffffff; @@ -2534,8 +2618,8 @@ }; } } - export class MethodCall extends OBInstruction { - MethodNameIdx; + class MethodCall extends OBInstruction { + // MethodNameIdx; init(code, builder, instructions, i) { this.MethodNameIdx = code & 0xFFFFFF; @@ -2544,10 +2628,10 @@ link(builder, instructions, idx) { let MethodName = builder.loader.data.GetString(this.MethodNameIdx); let anchor = instructions[idx - 1]; - if (!(anchor instanceof MethodCallRegisterInfoAnchor)) { - throw Error("last cmd is not MethodCallRegisterInfoAnchor"); + if (!(anchor instanceof ExtInfo)) { + throw Error("last cmd is not ExtInfo"); } - let RegisterInfoIdx = anchor.RegisterInfoIdx; + let RegisterInfoIdx = anchor.info; let args = builder.loader.data.GetInt32FromBin(RegisterInfoIdx); let uf1 = builder.loader.script.loadedFunctions[MethodName]; @@ -2555,7 +2639,7 @@ // 参数 let f = new OBVMFunction(uf1, builder, args); let returnRegister = args[0]; - if (returnRegister == -1) { + if (returnRegister === -1) { builder.PushAction((state, uf, localVars, pos) => { f.Call(state, f, localVars); return ++pos; @@ -2604,15 +2688,17 @@ } } } - export class BRIFN extends OBInstruction { - checkRegType; - checkRegIdx; - targetOffset; + class BRIFN extends OBInstruction { + // checkRegType; + // checkRegIdx; + // targetOffset; + // targetOffsetBak; init(code, builder, instructions, i) { this.checkRegType = ((code >> 20) & 0xf); this.checkRegIdx = ((code >> 14) & 0x7f); - this.targetOffset = (((code & 0x1fff) << 19) >> 19); //;// ((code) & 0x1fff); + this.targetOffset = ((code) & 0x1fff);//(((code & 0x1fff) << 19) >> 19); //;// ((code) & 0x1fff); + this.targetOffsetBak = this.targetOffset; builder.PositionUpdate(this.targetOffset * 4, (newPos) => { this.targetOffset = newPos; }); @@ -2625,7 +2711,7 @@ case 0: let LongReg = builder.LongRegister[checkRegIdx]; builder.PushAction((st, uf, locals, pos) => { - if (LongReg(st, uf, locals) == 0) { + if (LongReg(st, uf, locals) === 0) { return this.targetOffset; } else { return ++pos; @@ -2635,7 +2721,7 @@ case 1: let DoubleReg = builder.DoubleRegister[checkRegIdx]; builder.PushAction((st, uf, locals, pos) => { - if (DoubleReg(st, uf, locals) == 0) { + if (DoubleReg(st, uf, locals) === 0) { return this.targetOffset; } else { return ++pos; @@ -2646,7 +2732,7 @@ let StringReg = builder.StringRegister[checkRegIdx]; builder.PushAction((st, uf, locals, pos) => { let str = StringReg(st, uf, locals); - if (str == null || ("" == (str))) { + if (str == null || ("" === (str))) { return this.targetOffset; } else { return ++pos; @@ -2678,8 +2764,8 @@ } } } - export class BR extends OBInstruction { - Offset; + class BR extends OBInstruction { + // Offset; init(code, builder, instructions, i) { this.Offset = ((code << 8) >> 8); @@ -2694,17 +2780,17 @@ }); } } - export class NOP extends OBInstruction { + class NOP extends OBInstruction { link(builder, instructions, idx) { builder.PushAction((st, uf, locals, pos) => { return pos + 1; }); } } - export class ARITHF extends OBInstruction { - Opcode; - LeftRegister; - RightRegister; + class ARITHF extends OBInstruction { + // Opcode; + // LeftRegister; + // RightRegister; init(code, builder, instructions, i) { this.LeftRegister = (code >> 10) & 0x3FF; @@ -2772,10 +2858,10 @@ } } - export class ARITHI extends OBInstruction { - Opcode; - LeftRegister; - RightRegister; + class ARITHI extends OBInstruction { + // Opcode; + // LeftRegister; + // RightRegister; init(code, builder, instructions, i) { this.LeftRegister = (code >> 10) & 0x3FF; @@ -2842,14 +2928,14 @@ builder.LongRegister[this.LeftRegister] = o; } } - export class LDI extends OBInstruction { - Register; - Value; + class LDI extends OBInstruction { + // Register; + // Value; init(code, builder, instructions, i) { let pos = code & 0xFFF; this.Value = builder.loader.data.getInt32(pos * 4); // 4字节对齐 - this.Register = ((code & 0xFFF000) >> 12); + this.Register = ((code & 0xFF0000) >> 16); } link(builder, instructions, idx) { @@ -2858,27 +2944,27 @@ }; } } - export class LDF extends OBInstruction { - Register; - Value; + class LDF extends OBInstruction { + // Register; + // Value; init(code, builder, instructions, i) { - let specal = code & 0xFFF; + let specal = code & 0xFFFF; switch (specal) { - case 0xFFE: + case 0xFFFE: this.Value = Number.POSITIVE_INFINITY; break; - case 0xFFD: + case 0xFFFD: this.Value = Number.NEGATIVE_INFINITY; break; - case 0xFFF: + case 0xFFFF: this.Value = Number.NaN; break; default: this.Value = builder.loader.data.getFloat(specal * 4); break; } - this.Register = ((code & 0xFFF000) >> 12); + this.Register = ((code & 0xFF0000) >> 16); } link(builder, instructions, idx) { @@ -2887,9 +2973,9 @@ }; } } - export class RET extends OBInstruction { - RegisterType; - RegisterIdx; + class RET extends OBInstruction { + // RegisterType; + // RegisterIdx; init(code, builder, instructions, i) { this.RegisterType = ((code & 0xF00000) >> 20); @@ -2951,10 +3037,10 @@ } } } - export class FSMVG extends OBInstruction { - Register; - VarIdx; - RegisterType; + class FSMVG extends OBInstruction { + // Register; + // VarIdx; + // RegisterType; init(code, builder, instructions, i) { this.Register = (code & 0xFF00) >> 8; @@ -2996,9 +3082,9 @@ } } } - export class CreateFSM extends OBInstruction { - FSMTypeName; - ReturnRegister; + class CreateFSM extends OBInstruction { + // FSMTypeName; + // ReturnRegister; init(code, builder, instructions, i) { let FSMTypeNameIdx = code & 0xFFFF; @@ -3011,16 +3097,18 @@ let fsm = st.fsm.VM.CreateFSM(this.FSMTypeName); if (!fsm) { st.fsm.VM.Log("未找到FSM类型 " + this.FSMTypeName); + } else { + fsm.Target = st.fsm.Target; } return fsm; }; } } - export class FSMSendMsg extends OBInstruction { - TitleIdx; - TargetIdx; - BodyTypeID; - BodyRegisterIdx; + class FSMSendMsg extends OBInstruction { + // TitleIdx; + // TargetIdx; + // BodyTypeID; + // BodyRegisterIdx; init(code, builder, instructions, i) { this.TargetIdx = ((code >> 17) & 0x7F); @@ -3028,6 +3116,13 @@ this.BodyTypeID = ((code >> 6) & 0xF); this.BodyRegisterIdx = (code & 0x3F); + if (this.BodyTypeID == 4) { + let typedata = instructions[i - 1]; + if (!(typedata instanceof ExtInfo)) { + throw Error("last cmd is not ExtInfo"); + } + this.TypeName = builder.loader.data.GetString(typedata.info); + } } /** * @@ -3044,7 +3139,13 @@ if (fsm) { let title = f_title(st, uf, locals); let body = f_body(st, uf, locals); - fsm.PostMessage(new OBUserMessage(title, OBMessage.ArgTypeOf(this.BodyTypeID, body), body, st.fsm)); + let typename; + if (this.BodyTypeID == 4) { + typename = this.TypeName; + } else { + typename = OBMessage.ArgTypeOf(this.BodyTypeID, body); + } + fsm.PostMessage(new OBUserMessage(title, typename, body, st.fsm)); } return ++pos; }); @@ -3089,10 +3190,10 @@ } } } - export class GZ0 extends OBInstruction { - VarType; - VarIdx; - ResultIdx; + class GZ0 extends OBInstruction { + // VarType; + // VarIdx; + // ResultIdx; init(code, builder, instructions, i) { this.VarType = ((code >> 20) & 0xf); @@ -3141,15 +3242,15 @@ } } - export class BRIF extends OBInstruction { - checkRegType; - checkRegIdx; - targetOffset; + class BRIF extends OBInstruction { + // checkRegType; + // checkRegIdx; + // targetOffset; init(code, builder, instructions, i) { this.checkRegType = ((code >> 20) & 0xf); this.checkRegIdx = ((code >> 14) & 0x7f); - this.targetOffset = (((code & 0x1fff) << 19) >> 19); //;// ((code) & 0x1fff); + this.targetOffset = ((code) & 0x1fff); //;// ((code) & 0x1fff); builder.PositionUpdate(this.targetOffset * 4, (newPos) => { this.targetOffset = newPos; }); @@ -3183,7 +3284,7 @@ let StringReg = builder.StringRegister[checkRegIdx]; builder.PushAction((st, uf, locals, pos) => { let str = StringReg(st, uf, locals); - if (str != null && !("" == (str))) { + if (str != null && !("" === (str))) { return this.targetOffset; } else { return ++pos; @@ -3215,9 +3316,9 @@ } } } - export class DEC extends OBInstruction { - regType; - regIdx; + class DEC extends OBInstruction { + // regType; + // regIdx; init(code, builder, instructions, i) { this.regType = ((code >> 20) & 0xf); @@ -3226,30 +3327,19 @@ link(builder, instructions, idx) { let regIdx = this.regIdx; - let enable = true; switch (this.regType) { case 0: let LongReg = builder.LongRegister[regIdx]; builder.LongRegister[regIdx] = (st, uf, locals) => { - if (enable) { - enable = false; - let v = LongReg(st, uf, locals); - return v - 1; - } else { - throw Error("reentry"); - } + let v = LongReg(st, uf, locals); + return v - 1; }; break; case 1: let DoubleReg = builder.DoubleRegister[regIdx]; builder.DoubleRegister[regIdx] = (st, uf, locals) => { - if (enable) { - enable = false; - let v = DoubleReg(st, uf, locals); - return v - 1; - } else { - throw Error("reentry"); - } + let v = DoubleReg(st, uf, locals); + return v - 1; }; break; case 2: @@ -3260,10 +3350,10 @@ } } } - export class Reg2Var extends OBInstruction { - type; - varIdx; - regIdx; + class Reg2Var extends OBInstruction { + // type; + // varIdx; + // regIdx; init(code, builder, instructions, i) { this.type = ((code >> 20) & 0xf); @@ -3315,10 +3405,10 @@ } } } - export class Var2Reg extends OBInstruction { - type; - varIdx; - regIdx; + class Var2Reg extends OBInstruction { + // type; + // varIdx; + // regIdx; init(code, builder, instructions, i) { this.type = ((code >> 20) & 0xf); @@ -3360,9 +3450,9 @@ } } } - export class I2F extends OBInstruction { - intRegIdx; - floatRegIdx; + class I2F extends OBInstruction { + // intRegIdx; + // floatRegIdx; init(code, builder, instructions, i) { this.intRegIdx = ((code) >> 12) & 0xFFF; @@ -3376,11 +3466,11 @@ }; } } - export class EQ extends OBInstruction { - ArgTypeId; - LeftIdx; - RightIdx; - RetIdx; + class EQ extends OBInstruction { + // ArgTypeId; + // LeftIdx; + // RightIdx; + // RetIdx; init(code, builder, instructions, i) { this.ArgTypeId = (code >> 20) & 0xF; @@ -3419,15 +3509,15 @@ let LeftReg = regArr[this.LeftIdx]; let RightReg = regArr[this.RightIdx]; builder.LongRegister[this.RetIdx] = (st, uf, locals) => { - return LeftReg(st, uf, locals) == RightReg(st, uf, locals) ? 1 : 0; + return LeftReg(st, uf, locals) === RightReg(st, uf, locals) ? 1 : 0; }; } } - export class NEQ extends OBInstruction { - ArgTypeId; - LeftIdx; - RightIdx; - RetIdx; + class NEQ extends OBInstruction { + // ArgTypeId; + // LeftIdx; + // RightIdx; + // RetIdx; init(code, builder, instructions, i) { this.ArgTypeId = (code >> 20) & 0xF; @@ -3470,11 +3560,11 @@ }; } } - export class LT extends OBInstruction { - ArgTypeId; - LeftIdx; - RightIdx; - RetIdx; + class LT extends OBInstruction { + // ArgTypeId; + // LeftIdx; + // RightIdx; + // RetIdx; init(code, builder, instructions, i) { this.ArgTypeId = (code >> 20) & 0xF; @@ -3505,11 +3595,11 @@ }; } } - export class LTE extends OBInstruction { - ArgTypeId; - LeftIdx; - RightIdx; - RetIdx; + class LTE extends OBInstruction { + // ArgTypeId; + // LeftIdx; + // RightIdx; + // RetIdx; init(code, builder, instructions, i) { this.ArgTypeId = (code >> 20) & 0xF; @@ -3540,11 +3630,11 @@ }; } } - export class GT extends OBInstruction { - ArgTypeId; - LeftIdx; - RightIdx; - RetIdx; + class GT extends OBInstruction { + // ArgTypeId; + // LeftIdx; + // RightIdx; + // RetIdx; init(code, builder, instructions, i) { this.ArgTypeId = (code >> 20) & 0xF; @@ -3576,11 +3666,11 @@ } } - export class GTE extends OBInstruction { - ArgTypeId; - LeftIdx; - RightIdx; - RetIdx; + class GTE extends OBInstruction { + // ArgTypeId; + // LeftIdx; + // RightIdx; + // RetIdx; init(code, builder, instructions, i) { this.ArgTypeId = (code >> 20) & 0xF; @@ -3611,7 +3701,7 @@ }; } } - export class DestroyFSM extends OBInstruction { + class DestroyFSM extends OBInstruction { link(builder, instructions, idx) { builder.PushAction((st, uf, locals, pos) => { st.fsm.Destroy(); @@ -3619,10 +3709,10 @@ }); } } - export class FSMBroadcastMsg extends OBInstruction { - TitleIdx; - BodyTypeID; - BodyRegisterIdx; + class FSMBroadcastMsg extends OBInstruction { + // TitleIdx; + // BodyTypeID; + // BodyRegisterIdx; init(code, builder, instructions, i) { this.TitleIdx = ((code >> 10) & 0x7F); @@ -3636,7 +3726,7 @@ builder.PushAction((st, uf, locals, pos) => { let title = f_title(st, uf, locals); let body = f_body(st, uf, locals); - st.fsm.VM.BroadcastMessage(new OBUserMessage(title, OBMessage.ArgTypeOf(this.BodyTypeID, body), body), st.fsm); + st.fsm.VM.BroadcastMessage(new OBUserMessage(title, OBMessage.ArgTypeOf(this.BodyTypeID, body), body, st.fsm)); return ++pos; }); } @@ -3683,9 +3773,9 @@ /** * 单元数操作 */ - export class SGLF extends OBInstruction { - Opcode; - value; + class SGLF extends OBInstruction { + // Opcode; + // value; init(code, builder, instructions, i) { this.value = (code & 0xFFFF); @@ -3782,8 +3872,8 @@ } } } - export class RAND extends OBInstruction { - Register; + class RAND extends OBInstruction { + // Register; init(code, builder, instructions, i) { this.Register = (code & 0xFFFFFF); @@ -3795,9 +3885,9 @@ }; } } - export class F2I extends OBInstruction { - intRegIdx; - floatRegIdx; + class F2I extends OBInstruction { + // intRegIdx; + // floatRegIdx; init(code, builder, instructions, i) { this.intRegIdx = ((code) >> 12) & 0xFFF; @@ -3811,11 +3901,11 @@ }; } } - export class FSMSendMsgWait_Data extends OBInstruction { - TitleIdx; - TargetIdx; - BodyTypeID; - BodyRegisterIdx; + class FSMSendMsgWait_Data extends OBInstruction { + // TitleIdx; + // TargetIdx; + // BodyTypeID; + // BodyRegisterIdx; init(code, builder, instructions, i) { this.TargetIdx = ((code >> 17) & 0x7F); @@ -3824,8 +3914,8 @@ this.BodyRegisterIdx = (code & 0x3F); } } - export class FSMSendMsgWait extends OBInstruction { - waitMilliSecondIdx; + class FSMSendMsgWait extends OBInstruction { + // waitMilliSecondIdx; init(code, builder, instructions, i) { this.waitMilliSecondIdx = ((code >> 17) & 0x3F); @@ -3854,7 +3944,7 @@ throw Error("字节码错误"); } fsm.VM.Schedule(waitSecond, (VM) => { - fsm.PostMessage(new OBUserMessage(title, OBMessage.ArgTypeOf(anchor.BodyTypeID, body), body), FSM); + fsm.PostMessage(new OBUserMessage(title, OBMessage.ArgTypeOf(anchor.BodyTypeID, body), body, FSM)); }); return ++pos; }); @@ -3894,11 +3984,11 @@ } } } - export class FSMBroadcastMsgWait extends OBInstruction { - TitleIdx; - BodyTypeID; - BodyRegisterIdx; - waitMilliSecondIdx; + class FSMBroadcastMsgWait extends OBInstruction { + // TitleIdx; + // BodyTypeID; + // BodyRegisterIdx; + // waitMilliSecondIdx; init(code, builder, instructions, i) { this.TitleIdx = ((code >> 10) & 0x7F); @@ -3959,10 +4049,10 @@ } } } - export class TextJoin extends OBInstruction { - Left; - Right; - RetReg; + class TextJoin extends OBInstruction { + // Left; + // Right; + // RetReg; init(code, builder, instructions, i) { this.Left = (code >> 17) & 0xFF; @@ -3978,10 +4068,10 @@ }; } } - export class ToString extends OBInstruction { - ValueType; - ValueRegIdx; - RetRegIdx; + class ToString extends OBInstruction { + // ValueType; + // ValueRegIdx; + // RetRegIdx; init(code, builder, instructions, i) { this.ValueType = (code >> 20) & 0xF; @@ -4038,8 +4128,8 @@ } } } - export class Sender extends OBInstruction { - RetReg; + class Sender extends OBInstruction { + // RetReg; init(code, builder, instructions, i) { this.RetReg = code & 0xFFFF; @@ -4051,8 +4141,8 @@ }; } } - export class SHL extends OBInstruction { - value; bitCount; + class SHL extends OBInstruction { + // value; bitCount; init(code, builder, instructions, i) { this.bitCount = code & 0xFFF; this.value = (code & 0xFFF000) >> 12; @@ -4074,8 +4164,8 @@ }; } } - export class AND extends OBInstruction { - a; b; + class AND extends OBInstruction { + // a; b; init(code, builder, instructions, i) { this.b = code & 0xFFF; this.a = (code & 0xFFF000) >> 12; @@ -4091,8 +4181,8 @@ }; } } - export class FIX extends OBInstruction { - regType; regIdx; + class FIX extends OBInstruction { + // regType; regIdx; init(code, builder, instructions, i) { this.regIdx = code & 0xFFFFF; this.regType = (code & 0xF00000) >> 20; @@ -4118,7 +4208,7 @@ type = 'NObjectRegister'; break; default: - throw Error("Unknown type:" + this.ValueType); + throw Error("Unknown type:" + this.regType); } let getV = builder[type][this.regIdx]; builder[type][this.regIdx] = (st, f, l) => { @@ -4132,13 +4222,13 @@ } } /** - * value of may by key + * value of map by key */ - export class VOM extends OBInstruction { - map; - key; - ValueType; - RetRegIdx; + class VOM extends OBInstruction { + // map; + // key; + // ValueType; + // RetRegIdx; init(code, builder, instructions, i) { this.ValueType = code & 0x3F; this.RetRegIdx = (code & (0x3f << 6)) >> 6; @@ -4198,8 +4288,8 @@ } } } - export class LAND extends OBInstruction { - a; b; + class LAND extends OBInstruction { + // a; b; init(code, builder, instructions, i) { this.b = code & 0xFFF; this.a = (code & 0xFFF000) >> 12; @@ -4211,15 +4301,15 @@ let v = getV(st, f, l); if (v) { let c = getC(st, f, l); - return !!c; + return c ? 1 : 0; } else { return 0; } }; } } - export class LOR extends OBInstruction { - a; b; + class LOR extends OBInstruction { + // a; b; init(code, builder, instructions, i) { this.b = code & 0xFFF; this.a = (code & 0xFFF000) >> 12; @@ -4233,13 +4323,13 @@ return 1; } else { let c = getC(st, f, l); - return !!c; + return c ? 1 : 0; } }; } } - export class LNOT extends OBInstruction { - a; + class LNOT extends OBInstruction { + // a; init(code, builder, instructions, i) { this.a = code & 0xFFF; } @@ -4247,12 +4337,12 @@ let getV = builder.LongRegister[this.a]; builder.LongRegister[this.a] = (st, f, l) => { let v = getV(st, f, l); - return !v; + return v === 0 ? 1 : 0; }; } } - export class COND extends OBInstruction { - if_; then_; else_; regType; + class COND extends OBInstruction { + // if_; then_; else_; regType; init(code, builder, instructions, i) { this.regType = code & 0x3F; this.else_ = (code & (0x3f << 6)) >> 6; @@ -4293,4 +4383,142 @@ return else_(st, f, l); }; } - } \ No newline at end of file + } + class NEW extends OBInstruction { + // StructDef; + // Register; + + init(code, builder, instructions, i) { + let stridx = code & 0xFFF; + this.Register = (code & 0xFF0000) >> 16; + + let structType = builder.loader.data.GetString(stridx); + let structDef = builder.loader.script.StructDef[structType]; + if (!structDef) { + throw Error('不存在数据结构 ' + structType); + } + this.StructDef = structDef; + } + + link(builder, instructions, idx) { + builder.StructRegister[this.Register] = this.getValue.bind(this); + } + + getValue(UBState, obvmfunction, TypedRegisters) { + let s = new OBStructValue(this.StructDef); + return s; + } + } + + export class CSTR extends OBInstruction { + + init(code, builder, instructions, i) { + this.maxi = code & 0x3f; + this.mini = (code >> 6) & 0x3f; + this.valuei = (code >> 12) & 0x3f; + this.reti = (code >> 18) & 0x3f; + } + + link(builder, instructions, idx) { + let maxr = builder.DoubleRegister[this.maxi]; + let minr = builder.DoubleRegister[this.mini]; + let valuer = builder.DoubleRegister[this.valuei]; + builder.DoubleRegister[this.reti] = (st, f, l) => { + let v = valuer(st, f, l); + let max = maxr(st, f, l); + let min = minr(st, f, l); + return Math.min(Math.max(v, min), max); + }; + } + + } + + export class OBStructDataSerializer { + relocation = new Relocation(); + /** + * + * @param {OBStructValue[]} valueData + * @returns {int[]} + */ + serialize(valueDataArray) { + let group = this.groupData(valueDataArray); + } + /** + * + * @param {OBStructValue[]} valueDataArray + * @returns {Object. { + let list = group[d.Def.Name]; + if (!list) { + list = []; + group[d.Def.Name] = list; + } + this.collData(d); + list.push(d); + }); + return group; + } + /** + * + * @param {OBStructValue} d + */ + collData(d) { + d.string.forEach(str => { + this.relocation.addRelocationString(str); + }); + d.registers.object.forEach(ofd => { + switch (ofd.type.$__type) { + case "StructFieldTypeStruct": + break; + case "StructFieldTypeIntegerMap": + switch (ofd.type.elementType.name) { + case 'string': + case 'String': + Object.values(item.registers.object[ofd.registerIndex]).forEach(str => { + this.addRelocationString(str); + }); + } + break; + case "StructFieldTypeStringMap": + switch (ofd.type.elementType.name) { + case 'string': + case 'String': + Object.values(item.registers.object[ofd.registerIndex]).forEach(str => { + this.addRelocationString(str); + }); + } + Object.keys(item.registers.object[ofd.registerIndex]).forEach(str => { + this.addRelocationString(str); + }); + break; + case "StructFieldTypeList": + switch (ofd.type.elementType.name) { + case 'string': + case 'String': + Object.values(item.registers.object[ofd.registerIndex]).forEach(str => { + this.addRelocationString(str); + }); + } + break; + default: + console.error(ofd); + throw Error("功能未实现 " + ofd.type.$__type); + } + }); + } + } + // module.exports = { + // OBScriptLoader, + // OBVM + // } + export { + OBScriptLoader, + OBVM, + OBEventMessage, + OBMessage, + OBUserMessage + } + \ No newline at end of file diff --git a/hap/entry/src/main/js/MainAbility/i18n/en-US.json b/hap/entry/src/main/js/MainAbility/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..55561b83737c3c31d082fbfa11e5fc987a351104 --- /dev/null +++ b/hap/entry/src/main/js/MainAbility/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": { + } +} \ No newline at end of file diff --git a/hap/entry/src/main/js/MainAbility/i18n/zh-CN.json b/hap/entry/src/main/js/MainAbility/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..cce1af06761a42add0cac1a0567aa3237eda8cb4 --- /dev/null +++ b/hap/entry/src/main/js/MainAbility/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + }, + "Files": { + } +} \ No newline at end of file diff --git a/hap/entry/src/main/js/default/pages/index/index.css b/hap/entry/src/main/js/MainAbility/pages/index/index.css similarity index 93% rename from hap/entry/src/main/js/default/pages/index/index.css rename to hap/entry/src/main/js/MainAbility/pages/index/index.css index f8f510e01cebe0ebc024efad518f0b4d9e4047fe..280f036047ad191d148bd69695dfa54e453dad42 100644 --- a/hap/entry/src/main/js/default/pages/index/index.css +++ b/hap/entry/src/main/js/MainAbility/pages/index/index.css @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2020-2021 Du Tian Wei * 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 diff --git a/hap/entry/src/main/js/default/pages/index/index.hml b/hap/entry/src/main/js/MainAbility/pages/index/index.hml similarity index 42% rename from hap/entry/src/main/js/default/pages/index/index.hml rename to hap/entry/src/main/js/MainAbility/pages/index/index.hml index 03298ce11cb62ba73404d7275a2cd6fd5052e207..789d88e044751567b3d3abe6fa7a7584109574bf 100644 --- a/hap/entry/src/main/js/default/pages/index/index.hml +++ b/hap/entry/src/main/js/MainAbility/pages/index/index.hml @@ -11,18 +11,26 @@ 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. + ontouchstart="ob_touchstart" + ontouchmove="ob_touchmove" ontouchcancel="ob_touchcancel" + ontouchend="ob_touchend" onlongpress="ob_longpress" + + onclick="ob_click" --> - - -
- + +
+
+ {{ info }}
- + + +
+ +
- \ No newline at end of file +
\ No newline at end of file diff --git a/hap/entry/src/main/js/MainAbility/pages/index/index.js b/hap/entry/src/main/js/MainAbility/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..87a2212e13ffbc872846860be946fe4131e0aaf2 --- /dev/null +++ b/hap/entry/src/main/js/MainAbility/pages/index/index.js @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2020-2021 Du Tian Wei + * 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 router from '@system.router'; +import fileio from '@ohos.fileio'; +import * as obvm from '../../common/runtime/vm.js'; +import * as obcanvaslib from '../../common/canvas.js' +import featureAbility from '@ohos.ability.featureAbility' +import prompt from '@system.prompt'; +import app from '@system.app'; + +let filepath = '/data/openblock.xe'; +// https://github.com/uxitten/polyfill/blob/master/string.polyfill.js +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart +if (!String.prototype.padStart) { + String.prototype.padStart = function padStart(targetLength,padString) { + targetLength = targetLength>>0; //floor if number or convert non-number to 0; + padString = String((typeof padString !== 'undefined' ? padString : ' ')); + if (this.length > targetLength) { + return String(this); + } + else { + targetLength = targetLength-this.length; + if (targetLength > padString.length) { + padString += padString.repeat(targetLength/padString.length); //append to original to ensure we are longer than needed + } + return padString.slice(0,targetLength) + String(this); + } + }; +} +if (!Object.values) Object.values = function(obj) { + if (obj !== Object(obj)) + throw new TypeError('Object.values called on a non-object'); + var val=[],key; + for (key in obj) { + if (Object.prototype.hasOwnProperty.call(obj,key)) { + val.push(obj[key]); + } + } + return val; +} + + + +export default { + data: { + info: "info:", + vm: null, + fsm: null, + uninited: true, + updateInterval: 0, + fileCheckInterval: 0, + filectime: -1, + ui: [{ + type: 'button' + }] + }, + log(s) { + console.log('OpenBlock '+s); + this.info +="\n"+ s; + }, + ob_event(name) { + this.log(name); + try { + if (this.vm) { + this.log("1"); + this.vm.BroadcastMessage(new obvm.OBEventMessage(name, "", null, null)); + this.log("2"); + } + } catch (e) { + this.log(e + ""); + } + }, + ob_click(e) { + this.ob_event("click"); + }, + touchStart(e) { + this.ob_event("touchstart"); + }, + ob_touchmove(e) { + this.ob_event("touchmove"); + }, + ob_touchend(e) { + this.ob_event("touchend"); + }, + ob_longpress(e) { + this.ob_event("longpress"); + }, + ob_swipe(e) { + this.ob_event("swipe"); + }, + initStage() { + + var context = featureAbility.getContext(); + context.getOrCreateLocalDir().then((dir) => { +// this.log("root dir=" + dir); + let stage = this.$refs.canvas1; + + try { +// console.log('openblock 中文'+'测试'); + // /storage/media/100/local/files + + filepath = dir + "/main.xe";//"/data/"+app.getInfo().appID+"/main.xe"; +// this.log(filepath); +// stage.width = stage.width; + let fd = fileio.openSync(filepath, 0o2); + let st = fileio.fstatSync(fd); + let scriptArrayBuffer = new ArrayBuffer(st.size); + fileio.readSync(fd, scriptArrayBuffer); + + let obcanvas = new obcanvaslib.OBCanvas2D(stage); + // let ctx = stage.getContext('2d'); + // ctx.fillRect(15, 15, 50, 50); + + let nativeLibs = [obcanvas.install.bind(obcanvas)]; + let loader = obvm.OBScriptLoader; + let loadedScript = loader.loadScript(scriptArrayBuffer, nativeLibs); + this.vm = new obvm.OBVM(loadedScript,{setTimeout:setTimeout,Output:this.log}); + // // vm.Output = alert.bind(window); + // this.vm.Output = this.log;//prompt.showToast; + let fsmname = 'Start.Main'; + let fsm = this.vm.CreateFSM(fsmname); + if (!fsm) { + this.log('no fsm'); + throw Error("No FSM named " + fsmname); + } + this.log(fsmname + ' created'); + this.fsm = fsm; + } catch (e) { + this.log("\nERROR:"+e.toString()+"\n" + JSON.stringify(e)); + } finally { + } + }); + }, + pageError(e){ + this.log(e.message); + }, + onActive() { + setTimeout(()=>{ + if (this.uninited) { + this.uninited = false; + this.initStage(); + } + this.updateInterval = setInterval(this.update, 5000); + this.fileCheckInterval = setInterval(this.checkFile, 3000); + },1); + }, + checkFile() { +// let fd = fileio.openSync(filepath, 0o2); + let stat = fileio.statSync(filepath); + let ctime = stat.ctime; +// fileio.closeSync(fd); + if (this.filectime == -1) { + this.filectime = ctime; + } else if (this.filectime != ctime) { + this.filectime = ctime; + this.initStage(); + } + }, + onInactive() { + clearInterval(this.updateInterval); + clearInterval(this.fileCheckInterval); + }, + update() { + if(this.info.length > 500){ + this.info = this.info.substring(500); + } + try { + if (this.vm) { + this.vm.update(); + } + }catch(e){ + this.log("\nERROR:"+e.toString()+"\n" + JSON.stringify(e)); + } + }, + onchange(type) { + router.push({ + uri: "pages/" + type + "/index" + }) + } +} diff --git a/hap/entry/src/main/js/MainAbility/pages/second/page.css b/hap/entry/src/main/js/MainAbility/pages/second/page.css new file mode 100644 index 0000000000000000000000000000000000000000..5a911242f2e4d49d4359a691faf707e61283e7f6 --- /dev/null +++ b/hap/entry/src/main/js/MainAbility/pages/second/page.css @@ -0,0 +1,20 @@ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 30px; +} + +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/hap/entry/src/main/js/MainAbility/pages/second/page.hml b/hap/entry/src/main/js/MainAbility/pages/second/page.hml new file mode 100644 index 0000000000000000000000000000000000000000..4d4939751faa5b46a1032410a9401bddf0d98627 --- /dev/null +++ b/hap/entry/src/main/js/MainAbility/pages/second/page.hml @@ -0,0 +1,19 @@ + +
+ + + {{info}} + +
diff --git a/hap/entry/src/main/js/MainAbility/pages/second/page.js b/hap/entry/src/main/js/MainAbility/pages/second/page.js new file mode 100644 index 0000000000000000000000000000000000000000..66ab5043d28a9193b12abe5cec577575cd6ef82c --- /dev/null +++ b/hap/entry/src/main/js/MainAbility/pages/second/page.js @@ -0,0 +1,27 @@ +/** + * @license + * Copyright 2021 Du Tian Wei + * SPDX-License-Identifier: Apache-2.0 + */ + import router from '@system.router' + +import util from '@ohos.util' +export default { + data: { + info: 'World' + }, + log(s) { + this.info += "\n" + s; + }, + onclick: function () { + }, + pageStart:function(e){ + this.log('pageStart'); + }, + pageFinish:function(e){ + this.log('pageFinish'); + }, + pageError:function(e){ + this.log('pageError'); + } +} diff --git a/hap/entry/src/main/js/MainAbility/pages/third/second.css b/hap/entry/src/main/js/MainAbility/pages/third/second.css new file mode 100644 index 0000000000000000000000000000000000000000..5a911242f2e4d49d4359a691faf707e61283e7f6 --- /dev/null +++ b/hap/entry/src/main/js/MainAbility/pages/third/second.css @@ -0,0 +1,20 @@ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0px; + top: 0px; + width: 100%; + height: 100%; +} + +.title { + font-size: 30px; +} + +.btn { + width: 50%; + height: 100px; + font-size: 40px; +} diff --git a/hap/entry/src/main/js/MainAbility/pages/third/second.hml b/hap/entry/src/main/js/MainAbility/pages/third/second.hml new file mode 100644 index 0000000000000000000000000000000000000000..9ed7aa623e327b7e9f675a124c0904875f094939 --- /dev/null +++ b/hap/entry/src/main/js/MainAbility/pages/third/second.hml @@ -0,0 +1,19 @@ + +
+ + + {{info}} + +
diff --git a/hap/entry/src/main/js/MainAbility/pages/third/second.js b/hap/entry/src/main/js/MainAbility/pages/third/second.js new file mode 100644 index 0000000000000000000000000000000000000000..7773796416dc398f2c0a957bbbac2cf79fc6015b --- /dev/null +++ b/hap/entry/src/main/js/MainAbility/pages/third/second.js @@ -0,0 +1,69 @@ +/** + * @license + * Copyright 2021 Du Tian Wei + * SPDX-License-Identifier: Apache-2.0 + */ +import router from '@system.router' + +import util from '@ohos.util' +export default { + data: { + info: 'World' + }, + log(s) { + this.info += "\n" + s; + }, + onclick: function () { + let code = [83 +, 116 +, 97 +, 114 +, 116 +, 46 +, 229 +, 155 +, 189 +, 229 +, 174 +, 182 +, 231 +, 130 +, 185] + + let ui8 = new Uint8Array(code); + let utf8decoder = new util.TextDecoder("utf-8", { + fatal: true + }); + let str = utf8decoder.decode(ui8); + console.log('openblock getString '+str); + let cache = {}; + cache[4] = str; + setTimeout(()=>{ + + let ostr = cache[4]; + console.log('openblock String '+ostr); + console.log('openblock comp String '+(str==ostr)); + let obj = {}; + obj[str] = "abc"; + + setTimeout(()=>{ + let value = obj[ostr]; + console.log('openblock value:'+value); + obj[ostr] = "bcd"; + value = obj[str]; + console.log('openblock value:'+value); + value = obj[ostr]; + console.log('openblock value:'+value); + + let value1 = JSON.parse(JSON.stringify(value)); + console.log('openblock value1:'+value1); + console.log('openblock comp value01:'+(value==value1)); + + value = 'Start.国家点'; + value1 = cache[4]; + console.log('openblock value1:'+value1); + console.log('openblock comp value01:'+(value==value1)); + },5); + },5); + } +} diff --git a/hap/entry/src/main/js/default/common/canvas.js b/hap/entry/src/main/js/default/common/canvas.js deleted file mode 100644 index 2d429a629b9623dcebacd45cc56af0d8e682c718..0000000000000000000000000000000000000000 --- a/hap/entry/src/main/js/default/common/canvas.js +++ /dev/null @@ -1,96 +0,0 @@ -export class OBCanvas2D { - /** - * @type {HTMLCanvasElement} - */ - canvas; - /** - * @type {CanvasRenderingContext2D} - */ - canvas2dctx; - /** - * - * @param {HTMLCanvasElement} canvas - */ - constructor(canvas) { - this.canvas = canvas; - this.canvas2dctx = canvas.getContext('2d'); - } - setFillStyleColor(color) { - let str_color; - if (color < 0) { - str_color = (Number.MAX_SAFE_INTEGER + color + 1).toString(16).substr(-8) - str_color = '#' + str_color; - } else { - str_color = '#' + color.toString(16).padStart(8, '0'); - } - this.canvas2dctx.fillStyle = str_color.substr(0,7); - } - /** - * 安装到脚本库 - * @param {OBScript} script - */ - install(script) { - let self = this; - script.InstallLib("canvas2d", "canvas2d", [ - self.closureVoid(this.canvas2dctx.fillRect.bind(this.canvas2dctx), ['LongRegister', 'LongRegister', 'LongRegister', 'LongRegister']), - self.closureVoid(this.canvas2dctx.clearRect.bind(this.canvas2dctx), ['LongRegister', 'LongRegister', 'LongRegister', 'LongRegister']), - // canvas2dctx.fillStyle=color - self.closureVoid(this.setFillStyleColor.bind(this), ['LongRegister']), - self.closureVoid(this.canvas2dctx.strokeRect.bind(this.canvas2dctx), ['LongRegister', 'LongRegister', 'LongRegister', 'LongRegister']), - self.closureVoid(this.canvas2dctx.fillText.bind(this.canvas2dctx), ['StringRegister', 'LongRegister', 'LongRegister']), - self.closureVoid(this.canvas2dctx.beginPath.bind(this.canvas2dctx), []), - self.closureVoid(this.canvas2dctx.arc.bind(this.canvas2dctx), ['LongRegister', 'LongRegister', 'LongRegister', 'LongRegister', 'LongRegister']), - self.closureVoid(this.canvas2dctx.fill.bind(this.canvas2dctx), []), - self.closureVoid(this.canvas2dctx.closePath.bind(this.canvas2dctx), []), - self.fieldSetter(this.canvas2dctx, 'font', 'StringRegister'), - self.fieldGetter(this.canvas2dctx, 'font', 'StringRegister'), - ]); - } - fieldSetter(target, fieldName, register) { - return (builder, args) => { - let getter = builder[register][args[1] & 0xfff]; - builder.PushAction((st, f, local, pos) => { - let v = getter(st, f, local); - target[fieldName] = v; - return 1 + pos; - }); - }; - } - fieldGetter(target, fieldName, register) { - return (builder, args) => { - builder[register][args[1] & 0xfff] = (st, f, local) => { - return target[fieldName]; - }; - }; - } - /** - * - * @param {Function} func - * @param {Number[]} argtype - * @returns - */ - closureVoid(func, argtype) { - /** - * - * @param {OBFunctionBuilder} builder - * @param {Number[]} args - * @returns - */ - let f = (builder, args) => { - args = args.slice(1); - let argGetters = argtype.map((rtype, idx) => { - let idx1 = args[idx] & 0xFFF; - let v = builder[rtype][idx1]; - return (st, f, local) => { - return v(st, f, local); - }; - }); - builder.PushAction((st, f, local, pos) => { - let argVals = argGetters.map(g => g(st, f, local)); - func.apply(null, argVals); - return pos + 1; - }); - }; - return f; - } -} \ No newline at end of file diff --git a/hap/entry/src/main/js/default/common/runtime/util.js b/hap/entry/src/main/js/default/common/runtime/util.js deleted file mode 100644 index 9723535783d89154ea01545593305ff2dd0e0268..0000000000000000000000000000000000000000 --- a/hap/entry/src/main/js/default/common/runtime/util.js +++ /dev/null @@ -1,3 +0,0 @@ -import util from '@ohos.util' -let _TextDecoder = util.TextDecoder; -export { _TextDecoder as TextDecoder }; \ No newline at end of file diff --git a/hap/entry/src/main/js/default/i18n/en-US.json b/hap/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index ac2a096c9233bc155e36211509e7f897eae6ea2c..0000000000000000000000000000000000000000 --- a/hap/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "strings": { - "hide_capabilities": "Hidden capabilities", - "percentage": "Proportion capability", - "fixed_scale": "Fixed scale", - - "displaystyle": "display", - "hidestyle": "hide", - - "refresh": "refresh", - "return": "reset" - } -} \ No newline at end of file diff --git a/hap/entry/src/main/js/default/i18n/zh-CN.json b/hap/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index 10e687f9dca70b61e7dfca8af599e5f69b5d5e5b..0000000000000000000000000000000000000000 --- a/hap/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "strings": { - "hide_capabilities": "隐藏能力", - "percentage": "占比能力", - "fixed_scale": "固定比例", - - "displaystyle": "显示", - "hidestyle": "隐藏", - - "refresh": "刷新", - "return": "重置" - } -} \ No newline at end of file diff --git a/hap/entry/src/main/js/default/pages/index/index.js b/hap/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index f10700b5dea9b713e0a8fd1b12e00794f8df0dee..0000000000000000000000000000000000000000 --- a/hap/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,104 +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. - */ - -import router from '@system.router'; -import fileio from '@ohos.fileio'; -import * as obvm from '../../common/runtime/vm.js'; -import * as obcanvaslib from '../../common/canvas.js' -import prompt from '@system.prompt'; - -let filepath = '/data/openblock.xe'; -export default { - data: { - info: null, - vm: null, - fsm: null, - uninited: true, - updateInterval: 0, - fileCheckInterval: 0, - filectime: -1, - ui: [{ - type: 'button' - }] - }, - ob_event(name) { - if (this.fsm) { - this.fsm.PostMessage(new obvm.OBEventMessage(name, null, null, this)); - } - }, - initStage() { - let stage = this.$refs.canvas1; - try { - stage.width = stage.width; - let fd = fileio.openSync(filepath, 0o2); - let st = fileio.fstatSync(fd); - let scriptArrayBuffer = new ArrayBuffer(st.size); - fileio.readSync(fd, scriptArrayBuffer); - - let obcanvas = new obcanvaslib.OBCanvas2D(stage); - // let ctx = stage.getContext('2d'); - // ctx.fillRect(15, 15, 50, 50); - - let nativeLibs = [obcanvas.install.bind(obcanvas)]; - let loader = obvm.OBScriptLoader; - let loadedScript = loader.loadScript(scriptArrayBuffer, nativeLibs); - this.vm = new obvm.OBVM(loadedScript); - // // vm.Output = alert.bind(window); - this.vm.Output = prompt.showToast; - let fsmname = 'Start.Main'; - let fsm = this.vm.CreateFSM(fsmname); - if (!fsm) { - throw Error("No FSM named " + fsmname); - } - this.fsm = fsm; - } catch (e) { - this.info = "\nERROR:" + e.toString(); - } finally { - } - }, - onActive() { - if (this.uninited) { - this.uninited = false; - this.initStage(); - } - this.updateInterval = setInterval(this.update, 30); - this.fileCheckInterval = setInterval(this.checkFile, 3000); - }, - checkFile() { - let fd = fileio.openSync(filepath, 0o2); - let stat = fileio.fstatSync(fd); - let ctime = stat.ctime; - if (this.filectime == -1) { - this.filectime = ctime; - } else if (this.filectime != ctime) { - this.filectime = ctime; - this.initStage(); - } - }, - onInactive() { - clearInterval(this.updateInterval); - clearInterval(this.fileCheckInterval); - }, - update() { - if (this.vm) { - this.vm.update(); - } - }, - onchange(type) { - router.push({ - uri: "pages/" + type + "/index" - }) - } -} diff --git a/hap/entry/src/main/resources/base/element/string.json b/hap/entry/src/main/resources/base/element/string.json index d3882f9b4b797db19b46bd64f2e882a031e90a6e..1fd213efc02577397406a8afb8c9b76b9a6e6bbc 100644 --- a/hap/entry/src/main/resources/base/element/string.json +++ b/hap/entry/src/main/resources/base/element/string.json @@ -1,12 +1,16 @@ { "string": [ { - "name": "app_name", - "value": "OpenBlock" + "name": "entry_desc", + "value": "OpenBlock for OpenHarmony HAP" + }, + { + "name": "MainAbility_desc", + "value": "OpenBlock for OpenHarmony HAP" }, { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" + "name": "MainAbility_label", + "value": "OpenBlock" } ] } \ No newline at end of file diff --git a/hap/gradle.properties b/hap/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..be492496f9a20ac2d980ef4fc30061f4184c1c40 --- /dev/null +++ b/hap/gradle.properties @@ -0,0 +1,13 @@ +# Project-wide Gradle settings. +# IDE (e.g. DevEco Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# If the Chinese output is garbled, please configure the following parameter. +# This function is enabled by default when the DevEco Studio builds the hap/app,if you need disable gradle parallel,you should set org.gradle.parallel false. +# more information see https://docs.gradle.org/current/userguide/performance.html +# org.gradle.parallel=false +# org.gradle.jvmargs=-Dfile.encoding=GBK \ No newline at end of file diff --git a/hap/gradle/wrapper/gradle-wrapper.jar b/hap/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..490fda8577df6c95960ba7077c43220e5bb2c0d9 Binary files /dev/null and b/hap/gradle/wrapper/gradle-wrapper.jar differ diff --git a/hap/gradle/wrapper/gradle-wrapper.properties b/hap/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000000000000000000000000000000..d2e5af2afa06099f59dbb1ae32daae52f32e7217 --- /dev/null +++ b/hap/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Sat Feb 19 12:29:13 CST 2022 +distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/hap/gradlew b/hap/gradlew new file mode 100644 index 0000000000000000000000000000000000000000..2fe81a7d95e4f9ad2c9b2a046707d36ceb3980b3 --- /dev/null +++ b/hap/gradlew @@ -0,0 +1,183 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# 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 +# +# https://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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/hap/gradlew.bat b/hap/gradlew.bat new file mode 100644 index 0000000000000000000000000000000000000000..62bd9b9ccefea2b65ae41e5d9a545e2021b90a1d --- /dev/null +++ b/hap/gradlew.bat @@ -0,0 +1,103 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/hap/hvigorfile.js b/hap/hvigorfile.js new file mode 100644 index 0000000000000000000000000000000000000000..cff9f0dfcf8cb00cca34e7f50d61380cf5496868 --- /dev/null +++ b/hap/hvigorfile.js @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').legacyAppTasks \ No newline at end of file diff --git a/hap/local.properties b/hap/local.properties index 5956d59a86f1df6fcbca305382c7e7de0d7ec672..30ce7206ca779e16182898cfe26b4c7313a1ac63 100644 --- a/hap/local.properties +++ b/hap/local.properties @@ -1,13 +1,10 @@ -## This file is automatically generated by DevEco Studio. +# This file is automatically generated by DevEco Studio. # Do not modify this file -- YOUR CHANGES WILL BE ERASED! # -# This file must *NOT* be checked into Version Control Systems, +# This file should *NOT* be checked into Version Control Systems, # as it contains information specific to your local configuration. # -# Location of the SDK. This is only used by Gradle. -# For customization when using a Version Control System, please read the -# header note. -#Sat Sep 18 23:37:45 CST 2021 -nodejs.dir=C\:\\Program Files\\Huawei\\DevEco Studio 2.2.0.200\\tools\\nodejs -npm.dir=C\:\\Program Files\\Huawei\\DevEco Studio 2.2.0.200\\tools\\nodejs -hwsdk.dir=C\:\\openharmony\\OpenHarmony-SDK-2.0-Canary\\OpenHarmony-SDK-2.0-Canary +# For customization when using a Version Control System, please read the header note. +sdk.dir=C:/Users/Administrator/AppData/Local/OpenHarmony/Sdk +nodejs.dir=C:/Program Files/Huawei/DevEco Studio 3.0.0.900/tools/nodejs +npm.dir=C:/Program Files/Huawei/DevEco Studio 3.0.0.900/tools/nodejs diff --git a/hap/package-lock.json b/hap/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..aa000177fabc46d0e72c160fbb8535fee9ad633a --- /dev/null +++ b/hap/package-lock.json @@ -0,0 +1,1643 @@ +{ + "name": "openblock", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@ohos/hvigor": { + "version": "1.0.6", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor/-/@ohos/hvigor-1.0.6.tgz", + "integrity": "sha512-jjp7vpvUOMW1Nf7TdyhOtonwWHoSyBJLUiZTQqIx/GJV4UJyIqsiURUOqFwncQ4L7PDdeHuWly4uEelknYeWhg==", + "requires": { + "@ohos/hvigor-base": "1.0.6", + "interpret": "1.4.0", + "liftoff": "4.0.0", + "mute-stdout": "1.0.0", + "pretty-hrtime": "1.0.0", + "v8flags": "3.2.0", + "yargs": "7.1.0" + } + }, + "@ohos/hvigor-base": { + "version": "1.0.6", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor-base/-/@ohos/hvigor-base-1.0.6.tgz", + "integrity": "sha512-cRDnWICTxmpNiFb9clIioqP5Oik1seLCICztXVhZqultrHuxwTheCRUZrHwlpyWdkSB2Al+FFBqmSwzIgZX4IQ==", + "requires": { + "json5": "2.2.0", + "log4js": "6.4.1", + "undertaker": "1.2.1" + } + }, + "@ohos/hvigor-ohos-plugin": { + "version": "1.0.6", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor-ohos-plugin/-/@ohos/hvigor-ohos-plugin-1.0.6.tgz", + "integrity": "sha512-MAAi8uJxMzODUoSSNfBr+fU4HQ20dfQtkje9I+X4asc7qY2kAplW/q9f5XS8IOvv8zhC8OcSgsAXOAJuLMstOQ==", + "requires": { + "@ohos/hvigor-base": "1.0.6", + "@ohos/sdkmanager-common": "1.1.3", + "ajv": "8.10.0", + "archiver": "5.3.0", + "execa": "5.1.1", + "fs-extra": "10.0.0", + "glob": "7.2.0", + "iconv-lite": "0.6.3", + "json5": "2.2.0", + "lodash": "4.17.21", + "pretty-hrtime": "1.0.3", + "resolve-package-path": "4.0.3" + }, + "dependencies": { + "fs-extra": { + "version": "10.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" + } + } + }, + "@ohos/sdkmanager-common": { + "version": "1.1.3", + "resolved": "https://repo.harmonyos.com/npm/@ohos/sdkmanager-common/-/@ohos/sdkmanager-common-1.1.3.tgz", + "integrity": "sha512-d2uhVauDDJZIUvyyaWWoavG4N/jLyfF5IH5kEXKV6R8HNf3606H1zDQzA+UZtOfwwJFXhD9djRjnVFNB8xc7aw==" + }, + "ajv": { + "version": "8.10.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/ajv/-/ajv-8.10.0.tgz", + "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "archiver": { + "version": "5.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/archiver/-/archiver-5.3.0.tgz", + "integrity": "sha512-iUw+oDwK0fgNpvveEsdQ0Ase6IIKztBJU2U0E9MzszMfmVVUyv1QJhS2ITW9ZCqx8dktAxVAjWWkKehuZE8OPg==", + "requires": { + "archiver-utils": "^2.1.0", + "async": "^3.2.0", + "buffer-crc32": "^0.2.1", + "readable-stream": "^3.6.0", + "readdir-glob": "^1.0.0", + "tar-stream": "^2.2.0", + "zip-stream": "^4.1.0" + } + }, + "archiver-utils": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/archiver-utils/-/archiver-utils-2.1.0.tgz", + "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", + "requires": { + "glob": "^7.1.4", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash.defaults": "^4.2.0", + "lodash.difference": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.union": "^4.6.0", + "normalize-path": "^3.0.0", + "readable-stream": "^2.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + } + } + }, + "arr-filter": { + "version": "1.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/arr-filter/-/arr-filter-1.1.2.tgz", + "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", + "requires": { + "make-iterator": "^1.0.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "arr-map": { + "version": "2.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/arr-map/-/arr-map-2.0.2.tgz", + "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", + "requires": { + "make-iterator": "^1.0.0" + } + }, + "array-each": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=" + }, + "array-initial": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-initial/-/array-initial-1.1.0.tgz", + "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", + "requires": { + "array-slice": "^1.0.0", + "is-number": "^4.0.0" + } + }, + "array-last": { + "version": "1.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-last/-/array-last-1.3.0.tgz", + "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", + "requires": { + "is-number": "^4.0.0" + } + }, + "array-slice": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==" + }, + "async": { + "version": "3.2.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" + }, + "async-done": { + "version": "1.3.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.2", + "process-nextick-args": "^2.0.0", + "stream-exhaust": "^1.0.1" + } + }, + "async-settle": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/async-settle/-/async-settle-1.0.0.tgz", + "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", + "requires": { + "async-done": "^1.2.2" + } + }, + "bach": { + "version": "1.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/bach/-/bach-1.2.0.tgz", + "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", + "requires": { + "arr-filter": "^1.1.1", + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "array-each": "^1.0.0", + "array-initial": "^1.0.0", + "array-last": "^1.1.1", + "async-done": "^1.2.2", + "async-settle": "^1.0.0", + "now-and-later": "^2.0.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bl": { + "version": "4.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://repo.huaweicloud.com/repository/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "buffer": { + "version": "5.7.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://repo.huaweicloud.com/repository/npm/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "collection-map": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/collection-map/-/collection-map-1.0.0.tgz", + "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", + "requires": { + "arr-map": "^2.0.2", + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "compress-commons": { + "version": "4.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/compress-commons/-/compress-commons-4.1.1.tgz", + "integrity": "sha512-QLdDLCKNV2dtoTorqgxngQCMA+gWXkM/Nwu7FpeBhk/RdkzimqC3jueb/FDmaZeXh+uby1jkBqE3xArsLBE5wQ==", + "requires": { + "buffer-crc32": "^0.2.13", + "crc32-stream": "^4.0.2", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "crc-32": { + "version": "1.2.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==" + }, + "crc32-stream": { + "version": "4.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/crc32-stream/-/crc32-stream-4.0.2.tgz", + "integrity": "sha512-DxFZ/Hk473b/muq1VJ///PMNLj0ZMnzye9thBpmjpJKCc5eMgB95aK8zCGrGfQ90cWo561Te6HK9D+j4KPdM6w==", + "requires": { + "crc-32": "^1.2.0", + "readable-stream": "^3.4.0" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "d": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "date-format": { + "version": "4.0.6", + "resolved": "https://repo.huaweicloud.com/repository/npm/date-format/-/date-format-4.0.6.tgz", + "integrity": "sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw==" + }, + "debug": { + "version": "4.3.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "default-resolution": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/default-resolution/-/default-resolution-2.0.0.tgz", + "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=" + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=" + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es5-ext": { + "version": "0.10.60", + "resolved": "https://repo.huaweicloud.com/repository/npm/es5-ext/-/es5-ext-0.10.60.tgz", + "integrity": "sha512-jpKNXIt60htYG59/9FGf2PYT3pwMpnEbNKysU+k/4FGwyGtMotOvcZOuW+EmXXYASRqYSXQfGL5cVIthOTgbkg==", + "requires": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "execa": { + "version": "5.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "ext": { + "version": "1.6.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", + "requires": { + "type": "^2.5.0" + }, + "dependencies": { + "type": { + "version": "2.6.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/type/-/type-2.6.0.tgz", + "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "findup-sync": { + "version": "5.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/findup-sync/-/findup-sync-5.0.0.tgz", + "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==", + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.3", + "micromatch": "^4.0.4", + "resolve-dir": "^1.0.1" + } + }, + "fined": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fined/-/fined-2.0.0.tgz", + "integrity": "sha512-OFRzsL6ZMHz5s0JrsEr+TpdGNCtrVtnuG3x1yzGNiQHT0yaDnXAj8V/lWcpJVrnoDpcwXcASxAZYbuXda2Y82A==", + "requires": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^5.0.0", + "object.defaults": "^1.1.0", + "object.pick": "^1.3.0", + "parse-filepath": "^1.0.2" + } + }, + "flagged-respawn": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/flagged-respawn/-/flagged-respawn-2.0.0.tgz", + "integrity": "sha512-Gq/a6YCi8zexmGHMuJwahTGzXlAZAOsbCVKduWXC6TlLCjjFRlExMJc4GC2NYPYZ0r/brw9P7CpRgQmlPVeOoA==" + }, + "flatted": { + "version": "3.2.5", + "resolved": "https://repo.huaweicloud.com/repository/npm/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==" + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "for-own": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "requires": { + "for-in": "^1.0.1" + } + }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "fs-extra": { + "version": "10.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/fs-extra/-/fs-extra-10.0.1.tgz", + "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" + }, + "glob": { + "version": "7.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "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" + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "graceful-fs": { + "version": "4.2.10", + "resolved": "https://repo.huaweicloud.com/repository/npm/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + }, + "has": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://repo.huaweicloud.com/repository/npm/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" + }, + "hypium": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/hypium/-/hypium-1.0.0.tgz", + "integrity": "sha512-nl+RQVv2AU/5FvFRhsXyWO5wh+2huhdqRZ3bszBWZzW+kpNI3AT4ydvVRYIfaQbYwV4UlX/rSc7BtFjLAezhow==" + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://repo.huaweicloud.com/repository/npm/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.8", + "resolved": "https://repo.huaweicloud.com/repository/npm/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-core-module": { + "version": "2.8.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-core-module/-/is-core-module-2.8.1.tgz", + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "requires": { + "has": "^1.0.3" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "4.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + }, + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "requires": { + "unc-path-regex": "^0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "json5": { + "version": "2.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + }, + "last-run": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/last-run/-/last-run-1.1.1.tgz", + "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", + "requires": { + "default-resolution": "^2.0.0", + "es6-weak-map": "^2.0.1" + } + }, + "lazystream": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "requires": { + "readable-stream": "^2.0.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + } + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "liftoff": { + "version": "4.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/liftoff/-/liftoff-4.0.0.tgz", + "integrity": "sha512-rMGwYF8q7g2XhG2ulBmmJgWv25qBsqRbDn5gH0+wnuyeFt7QBJlHJmtg5qEdn4pN6WVAUMgXnIxytMFRX9c1aA==", + "requires": { + "extend": "^3.0.2", + "findup-sync": "^5.0.0", + "fined": "^2.0.0", + "flagged-respawn": "^2.0.0", + "is-plain-object": "^5.0.0", + "object.map": "^1.0.1", + "rechoir": "^0.8.0", + "resolve": "^1.20.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.defaults": { + "version": "4.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" + }, + "lodash.difference": { + "version": "4.5.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=" + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "lodash.union": { + "version": "4.6.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lodash.union/-/lodash.union-4.6.0.tgz", + "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=" + }, + "log4js": { + "version": "6.4.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/log4js/-/log4js-6.4.1.tgz", + "integrity": "sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==", + "requires": { + "date-format": "^4.0.3", + "debug": "^4.3.3", + "flatted": "^3.2.4", + "rfdc": "^1.3.0", + "streamroller": "^3.0.2" + } + }, + "make-iterator": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "requires": { + "kind-of": "^6.0.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://repo.huaweicloud.com/repository/npm/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.6", + "resolved": "https://repo.huaweicloud.com/repository/npm/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "mute-stdout": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/mute-stdout/-/mute-stdout-1.0.0.tgz", + "integrity": "sha1-WzLqB+tDyd7WEwQ0z5JvRrKn/U0=" + }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "now-and-later": { + "version": "2.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "requires": { + "once": "^1.3.2" + } + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "requires": { + "path-key": "^3.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "requires": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "object.map": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "requires": { + "isobject": "^3.0.1" + } + }, + "object.reduce": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/object.reduce/-/object.reduce-1.0.1.tgz", + "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "^1.0.0" + } + }, + "parse-filepath": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "requires": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "^1.2.0" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "requires": { + "path-root-regex": "^0.1.0" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=" + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "^2.0.0" + } + }, + "pretty-hrtime": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/pretty-hrtime/-/pretty-hrtime-1.0.0.tgz", + "integrity": "sha1-9ualItPmBwRSK/Db5oVu0g515Nw=" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdir-glob": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/readdir-glob/-/readdir-glob-1.1.1.tgz", + "integrity": "sha512-91/k1EzZwDx6HbERR+zucygRFfiPl2zkIYZtv3Jjr6Mn7SkKcVct8aVO+sSRiGMc6fLf72du3d92/uY63YPdEA==", + "requires": { + "minimatch": "^3.0.4" + } + }, + "rechoir": { + "version": "0.8.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", + "requires": { + "resolve": "^1.20.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "resolve": { + "version": "1.22.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "requires": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, + "resolve-package-path": { + "version": "4.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/resolve-package-path/-/resolve-package-path-4.0.3.tgz", + "integrity": "sha512-SRpNAPW4kewOaNUt8VPqhJ0UMxawMwzJD8V7m1cJfdSTK9ieZwS6K7Dabsm4bmLFM96Z5Y/UznrpG5kt1im8yA==", + "requires": { + "path-root": "^0.1.1" + } + }, + "rfdc": { + "version": "1.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/rfdc/-/rfdc-1.3.0.tgz", + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.11", + "resolved": "https://repo.huaweicloud.com/repository/npm/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==" + }, + "stream-exhaust": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==" + }, + "streamroller": { + "version": "3.0.6", + "resolved": "https://repo.huaweicloud.com/repository/npm/streamroller/-/streamroller-3.0.6.tgz", + "integrity": "sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg==", + "requires": { + "date-format": "^4.0.6", + "debug": "^4.3.4", + "fs-extra": "^10.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, + "tar-stream": { + "version": "2.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "requires": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + }, + "dependencies": { + "is-number": { + "version": "7.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + } + } + }, + "type": { + "version": "1.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=" + }, + "undertaker": { + "version": "1.2.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/undertaker/-/undertaker-1.2.1.tgz", + "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", + "requires": { + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "bach": "^1.0.0", + "collection-map": "^1.0.0", + "es6-weak-map": "^2.0.1", + "last-run": "^1.1.0", + "object.defaults": "^1.0.0", + "object.reduce": "^1.0.0", + "undertaker-registry": "^1.0.0" + } + }, + "undertaker-registry": { + "version": "1.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/undertaker-registry/-/undertaker-registry-1.0.1.tgz", + "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=" + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "v8flags": { + "version": "3.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://repo.huaweicloud.com/repository/npm/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "y18n": { + "version": "3.2.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.0" + } + }, + "yargs-parser": { + "version": "5.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/yargs-parser/-/yargs-parser-5.0.1.tgz", + "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", + "requires": { + "camelcase": "^3.0.0", + "object.assign": "^4.1.0" + } + }, + "zip-stream": { + "version": "4.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/zip-stream/-/zip-stream-4.1.0.tgz", + "integrity": "sha512-zshzwQW7gG7hjpBlgeQP9RuyPGNxvJdzR8SUM3QhxCnLjWN2E7j3dOvpeDcQoETfHx0urRS7EtmVToql7YpU4A==", + "requires": { + "archiver-utils": "^2.1.0", + "compress-commons": "^4.1.0", + "readable-stream": "^3.6.0" + } + } + } +} diff --git a/hap/package.json b/hap/package.json new file mode 100644 index 0000000000000000000000000000000000000000..7fea95cdca73411598caf36cd3b178f26b7524e6 --- /dev/null +++ b/hap/package.json @@ -0,0 +1,18 @@ +{ + "license":"ISC", + "devDependencies":{}, + "name":"openblock", + "ohos":{ + "org":"huawei", + "directoryLevel":"project", + "buildTool":"hvigor" + }, + "description":"example description", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/hvigor-ohos-plugin":"1.0.6", + "hypium":"^1.0.0", + "@ohos/hvigor":"1.0.6" + } +} \ No newline at end of file diff --git a/hap/settings.gradle b/hap/settings.gradle index 848717efd35171fb6854d82aca81b430f10f4cae..4773db73233a570c2d0c01a22e75321acfbf7a07 100644 --- a/hap/settings.gradle +++ b/hap/settings.gradle @@ -1,16 +1 @@ -/* - * 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. - */ - include ':entry'