From 9c132c67c2cffda3a7dc56392d1abff36aac9051 Mon Sep 17 00:00:00 2001 From: Vijay Suryawanshi Date: Sun, 18 Oct 2020 20:59:44 +0530 Subject: [PATCH] feat: use as node module --- .gitignore | 12 ++++++++++++ build_nodeaddon_mac.sh | 30 +++++++++++++++--------------- index.js | 27 +++++++++++++++++++++++++++ package.json | 25 +++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 15 deletions(-) create mode 100644 .gitignore create mode 100644 index.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b45478 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +build/ +node_modules/ +Debug/ +Release/ +*.lock +*.log +package-lock.json +npm-debug.log* + +.idea/ +.vscode/ +.DS_Store diff --git a/build_nodeaddon_mac.sh b/build_nodeaddon_mac.sh index d0410e3..d0149a5 100644 --- a/build_nodeaddon_mac.sh +++ b/build_nodeaddon_mac.sh @@ -1,23 +1,23 @@ +cd $(dirname $0) -cd `dirname $0` -if [ -d "./demo/node_modules" ];then -cd ./demo -npm run-script postinstall-mac +if [ -d "../../node_modules" ]; then + cd ../../ + yarn run postinstall-mac else -cd ./demo -npm install -npm run-script postinstall-mac + cd ../../ + yarn install + yarn run postinstall-mac fi version=$(electron --version) -if [ $? -ne 0 ];then -echo "build fail ,electron not install" -exit + +if [ $? -ne 0 ]; then + echo "build fail ,electron not install" + exit else -cd ../ -sed -i "" 's/8.2.4/'${version#*v}'/g' ./demo/package.json -node-gyp rebuild --target=${version#*v} --dist-url=https://atom.io/download/electron + cd ./node_modules/zoom-sdk-electron + sed -i "" 's/8.2.4/'${version#*v}'/g' ../../package.json + node-gyp rebuild --target=${version#*v} --dist-url=https://atom.io/download/electron fi -cp -Rf ./build/Release/zoomsdk.node ./sdk/mac && cp -Rf ./build/Release/zoomsdk_render.node ./sdk/mac - +cp -Rf ./build/Release/zoomsdk.node ./sdk/mac && cp -Rf ./build/Release/zoomsdk_render.node ./sdk/mac diff --git a/index.js b/index.js new file mode 100644 index 0000000..3f821d4 --- /dev/null +++ b/index.js @@ -0,0 +1,27 @@ +const { + ZOOM_TYPE_OS_TYPE, + ZoomSDK_LANGUAGE_ID, + ZoomSDKError, + ZoomAuthResult, + ZoomLoginStatus, + ZoomMeetingStatus, + ZoomMeetingUIFloatVideoType, + SDKCustomizedStringType, + SDKCustomizedURLType, + ZoomAPPLocale, +} = require("./lib/settings.js"); +const ZOOMSDKMOD = require("./lib/zoom_sdk.js"); + +module.exports = { + ZOOM_TYPE_OS_TYPE, + ZoomSDK_LANGUAGE_ID, + ZoomSDKError, + ZoomAuthResult, + ZoomLoginStatus, + ZoomMeetingStatus, + ZoomMeetingUIFloatVideoType, + SDKCustomizedStringType, + SDKCustomizedURLType, + ZoomAPPLocale, + ZOOMSDKMOD, +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..87c6f45 --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "zoom-sdk-electron", + "version": "v5.2.41735.0929", + "description": "Zoom Electron Sdk", + "main": "index.js", + "directories": { + "lib": "lib", + "sdk": "sdk" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "install": "node-gyp rebuild" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/zoom/zoom-sdk-electron.git" + }, + "author": "", + "license": "ISC", + "gypfile": true, + "bugs": { + "url": "https://github.com/zoom/zoom-sdk-electron/issues" + }, + "homepage": "https://github.com/zoom/zoom-sdk-electron#readme" +}