diff --git a/.gitignore b/.gitignore index f67aba5823cfc46c948533f848182bca087d8473..7e10c602b3de0059788fc163c62bfd0a86aef724 100644 --- a/.gitignore +++ b/.gitignore @@ -7,47 +7,35 @@ tmp .idea .local -src/nw/lib -src/nw/locales -src/nw/node_modules -src/nw/pnacl -src/nw/nw* -src/nw/*.bin -src/nw/chromedriver -src/nw/credits.html -src/nw/*.dat -src/nw/*.pak -src/nw/nacl* -src/nw/minidump* -src/nw/payload* -src/nw/yarn.lock -src/nw/package-lock.json -src/nw/cesium -src/nw/swiftshader/libEGL.so -src/nw/swiftshader/libGLESv2.so +www arch/linux/.vagrant arch/linux/cesium-* -arch/linux/*.js* -arch/linux/yarn* +arch/linux/splash.html +arch/linux/package.json +arch/linux/yarn.lock +arch/linux/LICENSE.txt arch/linux/ubuntu* arch/linux/nw* arch/windows/.vagrant arch/windows/cesium-* -arch/windows/*.js* -arch/windows/yarn* -arch/windows/ubuntu* -arch/windows/nw* +arch/windows/splash.html +arch/windows/package.json +arch/windows/yarn.lock +arch/windows/LICENSE.txt arch/windows/LICENSE.txt arch/windows/*.box arch/windows/.directory arch/osx/.vagrant arch/osx/cesium-* -arch/osx/yarn.* +arch/osx/splash.html +arch/osx/package.json +arch/osx/yarn.lock +arch/osx/LICENSE.txt arch/osx/*.xip arch/osx/*.box arch/osx/*.dmg -desktop +downloads diff --git a/src/nw/LICENSE.txt b/LICENSE similarity index 100% rename from src/nw/LICENSE.txt rename to LICENSE diff --git a/arch/linux/build-deb.sh b/arch/linux/build-deb.sh index 44c3211a92fd9a5fdb0395cf25adf9b28fd8a0ff..11babfaa34c5da0ffea14d184ad69d68faf0ad5e 100644 --- a/arch/linux/build-deb.sh +++ b/arch/linux/build-deb.sh @@ -10,34 +10,25 @@ export NVM_DIR="$HOME/.nvm" # Prepare NVER=$(node -v) -TAG= NW_VERSION=0.42.2 -NW_RELEASE="v${NW_VERSION}" -# Can be override with 'nwjs-sdk' -[[ "_$NW_BASENAME" == "_" ]] && NW_BASENAME="nwjs" -NW="${NW_BASENAME}-${NW_RELEASE}-linux-x64" -NW_GZ="${NW}.tar.gz" +NW_RELEASE=v${NW_VERSION} +NW_BASENAME=nwjs +#NW_BASENAME=nwjs-sdk +NW=${NW_BASENAME}-${NW_RELEASE}-linux-x64 +NW_GZ=${NW}.tar.gz # Folders ROOT=$(pwd) -DOWNLOADS="${ROOT}/downloads" -RELEASES="${ROOT}/releases" - -mkdir -p "${DOWNLOADS}" - -# ----------- -# Clean sources + releases -# ----------- -rm -rf "${DOWNLOADS}/${PROJECT_NAME}" -rm -rf "${RELEASES}" -rm -rf /vagrant/*.deb -rm -rf /vagrant/*.tar.gz +DOWNLOADS=${ROOT}/downloads +RELEASES=${ROOT}/releases # ----------- # Downloads # ----------- -cd "${DOWNLOADS}" +mkdir -p "${DOWNLOADS}" && cd "${DOWNLOADS}" || exit 1 + +rm -rf "${DOWNLOADS}/${PROJECT_NAME}" mkdir -p "${DOWNLOADS}/${PROJECT_NAME}" if [ ! -d "${DOWNLOADS}/${PROJECT_NAME}_src" ]; then @@ -51,26 +42,31 @@ else fi # Get release tag -COMMIT=`git rev-list --tags --max-count=1` -TAG=`echo $(git describe --tags $COMMIT) | sed 's/^v//'` -cd .. - -ZIP_BASENAME="${PROJECT_NAME}-v$TAG-web" -echo "Checking that ${PROJECT_NAME} binary has been downloaded" -if [ ! -e "${DOWNLOADS}/${ZIP_BASENAME}.zip" ]; then - echo "Have to download it into ${DOWNLOADS}" - cd ${PROJECT_NAME} - wget -kL "${REPO_PUBLIC_URL}/releases/download/v${TAG}/${ZIP_BASENAME}.zip" - unzip ${ZIP_BASENAME}.zip - rm ${ZIP_BASENAME}.zip - cd .. +COMMIT=$(git rev-list --tags --max-count=1) +PROJECT_VERSION=`echo $(git describe --tags $COMMIT) | sed 's/^v//'` +WEB_BASENAME=${PROJECT_NAME}-v${PROJECT_VERSION}-web +WEB_ZIP_FILE=${WEB_BASENAME}.zip + +# Compute output base name +if [[ "${NW_BASENAME}" == "nwjs-sdk" ]]; then + echo " SDK: true" + OUTPUT_BASENAME=${PROJECT_NAME}-desktop-v${PROJECT_VERSION}-sdk-linux-x64 +else + OUTPUT_BASENAME=${PROJECT_NAME}-desktop-v${PROJECT_VERSION}-linux-x64 fi -DEB_VER=" $TAG" -TAG="v$TAG" +if [ ! -d "${DOWNLOADS}/${WEB_ZIP_FILE}" ]; then + cd ${DOWNLOADS} + echo "Downloading ${WEB_ZIP_FILE} into ${DOWNLOADS} ..." + wget -kL "${REPO_PUBLIC_URL}/releases/download/v${PROJECT_VERSION}/${WEB_ZIP_FILE}" + + rm -rf ${PROJECT_NAME} && mkdir -p ${PROJECT_NAME} || exit 1 + unzip -o ${WEB_ZIP_FILE} -d "${DOWNLOADS}/${PROJECT_NAME}" + rm ${WEB_ZIP_FILE} +fi # Get NW.js -if [[ ! -d "${DOWNLOADS}/$NW" ]]; then +if [[ ! -d "${DOWNLOADS}/${NW}" ]]; then cd ${DOWNLOADS} echo "Downloading ${NW_GZ}..." wget -kL https://dl.nwjs.io/${NW_RELEASE}/${NW_GZ} @@ -81,13 +77,17 @@ fi # Releases # ----------- +# Clean previous artifacts +rm -rf "/vagrant/${OUTPUT_BASENAME}.deb" +rm -rf "/vagrant/${OUTPUT_BASENAME}.tar.gz" + +# Clean previous releases directory rm -rf "${RELEASES}" mkdir -p "${RELEASES}" -cp -r "${DOWNLOADS}/${PROJECT_NAME}" "${RELEASES}/${PROJECT_NAME}" - # Releases builds -cd "${RELEASES}/${PROJECT_NAME}" +mv "${DOWNLOADS}/${PROJECT_NAME}" "${RELEASES}/" && cd "${RELEASES}/${PROJECT_NAME}" || exit 1 + # Remove git files rm -Rf .git # Remove unused files (API, maps) @@ -109,14 +109,16 @@ mkdir -p "${RELEASES}/desktop_release" cp -r "${DOWNLOADS}/${NW}" "${RELEASES}/desktop_release/nw" cp -r "${RELEASES}/${PROJECT_NAME}" "${RELEASES}/desktop_release/nw/" +ls "${RELEASES}/desktop_release/nw/" -# Specific desktop files +# Copy Cesium desktop sources files cp -r /vagrant/package.json "${RELEASES}/desktop_release/nw/" cp -r /vagrant/yarn.lock "${RELEASES}/desktop_release/nw/" cp -r /vagrant/cesium-desktop.js "${RELEASES}/desktop_release/nw" cp -r /vagrant/splash.html "${RELEASES}/desktop_release/nw" + # Injection -sed -i 's/<script src="config.js"><\/script>/<script src="config.js"><\/script><script src="..\/cesium-desktop.js"><\/script>/' "${RELEASES}/desktop_release/nw/${PROJECT_NAME}/index.html" || exit 1 +sed -i 's/<script src="config.js"[^>]*><\/script>/<script src="config.js"><\/script><script src="..\/cesium-desktop.js"><\/script>/' ${RELEASES}/desktop_release/nw/${PROJECT_NAME}/index*.html || exit 1 # Specific desktop dependencies (for reading Duniter conf, ...) cd "${RELEASES}/desktop_release/nw" @@ -125,7 +127,7 @@ yarn # Releases cp -R "${RELEASES}/desktop_release" "${RELEASES}/desktop_release_tgz" cd "${RELEASES}/desktop_release_tgz" -tar czf /vagrant/${PROJECT_NAME}-desktop-${TAG}-linux-x64.tar.gz * --exclude ".git" --exclude "coverage" --exclude "test" +tar czf /vagrant/${OUTPUT_BASENAME}.tar.gz * --exclude ".git" --exclude "coverage" --exclude "test" # ------------------------------------------------- # Build Desktop version .deb @@ -136,11 +138,12 @@ cp -r "/vagrant/package" "${RELEASES}/${PROJECT_NAME}-x64" || exit 1 mkdir -p "${RELEASES}/${PROJECT_NAME}-x64/opt/${PROJECT_NAME}/" || exit 1 chmod 755 ${RELEASES}/${PROJECT_NAME}-x64/DEBIAN/post* chmod 755 ${RELEASES}/${PROJECT_NAME}-x64/DEBIAN/pre* -sed -i "s/Version:.*/Version:$DEB_VER/g" ${RELEASES}/${PROJECT_NAME}-x64/DEBIAN/control || exit 1 +sed -i "s/Version:.*/Version:${PROJECT_VERSION}/g" ${RELEASES}/${PROJECT_NAME}-x64/DEBIAN/control || exit 1 cd "${RELEASES}/desktop_release/nw" || exit 1 zip -qr "${RELEASES}/${PROJECT_NAME}-x64/opt/${PROJECT_NAME}/nw.nwb" * sed -i "s/Package: .*/Package: ${PROJECT_NAME}-desktop/g" "${RELEASES}/${PROJECT_NAME}-x64/DEBIAN/control" || exit 1 cd ${RELEASES}/ || exit 1 fakeroot dpkg-deb --build "${PROJECT_NAME}-x64" || exit 1 -mv "${PROJECT_NAME}-x64.deb" "/vagrant/${PROJECT_NAME}-desktop-${TAG}-linux-x64.deb" || exit 1 +mv "${PROJECT_NAME}-x64.deb" "/vagrant/${OUTPUT_BASENAME}.deb" || exit 1 + diff --git a/arch/linux/package/usr/share/doc/cesium/copyright b/arch/linux/package/usr/share/doc/cesium/copyright new file mode 100644 index 0000000000000000000000000000000000000000..4b006016d087f0ad09d02714db29c724b4b39412 --- /dev/null +++ b/arch/linux/package/usr/share/doc/cesium/copyright @@ -0,0 +1,7 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Cesium +Upstream-Contact: Duniter Team <contact@duniter.org> +Source: https://git.duniter.org/clients/cesium-grp/cesium +Copyright: 2017-2020 Benoit Lavenier +License: GPL-3+ +Files: * diff --git a/arch/linux/splash.html b/arch/linux/splash.html index a7f305e3a6b5496a859c597648c390a4fdce2e90..838bc51819281e5add242feec93db1d5616b5321 100644 --- a/arch/linux/splash.html +++ b/arch/linux/splash.html @@ -19,8 +19,8 @@ <script src="cesium-desktop.js"></script> - <!-- Preload JS files here --> + <!-- Preload JS files here <script src="cesium/dist_js/cesium.js" async></script> - <script src="cesium/dist_js/vendor.js" async></script> + <script src="cesium/dist_js/vendor.js" async></script>--> </body> </html> diff --git a/arch/osx/node.js b/arch/osx/node.js deleted file mode 100644 index 379cf571d6e272babf6c2caed95929928d22f3af..0000000000000000000000000000000000000000 --- a/arch/osx/node.js +++ /dev/null @@ -1,352 +0,0 @@ -// Rename "require" to avoid conflicts with pure JS libraries -requireNodejs = require -require = undefined - -const expectedCurrency = "g1" - -/**** NODEJS MODULES ****/ - -const fs = requireNodejs('fs'); -const path = requireNodejs('path'); -const yaml = requireNodejs('js-yaml'); -const bs58 = requireNodejs('bs58'); -const clc = requireNodejs('cli-color'); -const gui = requireNodejs('nw.gui'); - -Base58 = { - encode: (bytes) => bs58.encode(new Buffer(bytes)), - decode: (data) => new Uint8Array(bs58.decode(data)) -} - -/**** Program ****/ -const HOME = requireNodejs('os').homedir(); -const CESIUM_HOME = path.resolve(HOME, '.config/cesium/'); -const CESIUM_KEYRING = path.resolve(CESIUM_HOME, 'keyring.yml'); -const DUNITER_HOME = path.resolve(HOME, '.config/duniter/duniter_default'); -const DUNITER_CONF = path.resolve(DUNITER_HOME, 'conf.json'); -const DUNITER_KEYRING = path.resolve(DUNITER_HOME, 'keyring.yml'); -const DEFAULT_CESIUM_SETTINGS = { - "useRelative": false, - "timeWarningExpire": 2592000, - "useLocalStorage": true, - "rememberMe": true, - "keepAuthIdle": 600, - "helptip": { - "enable": false - }, - "plugins": { - "es": { - "enable": true, - "askEnable": false, - "useRemoteStorage": false, - "host": "g1.data.duniter.fr", - "port": "443", - "notifications": { - "txSent": true, - "txReceived": true, - "certSent": true, - "certReceived": true - } - } - }, - "showUDHistory": true -}; -const I18N = { - "fr": { - "MENU" : { - "FILE": "Fichier", - "QUIT_ITEM": "Quitter", - "WINDOW": "Fenêtre", - "NEW_WINDOW_ITEM": "Nouvelle fenêtre" - } - }, - "en": { - "MENU" : { - "FILE": "File", - "QUIT_ITEM": "Quit", - "WINDOW": "Window", - "NEW_WINDOW_ITEM": "New window" - } - } -}; - -function isSdkMode () { - return gui && (window.navigator.plugins.namedItem('Native Client') !== null); -} -function isMainWin() { - return gui && gui.Window.get().title && true; -} - -/**** Process command line args ****/ -var commands = gui && gui.App && gui.App.argv; -var options = { - debug: false, - menu: false -}; -if (commands && commands.length) { - for (i in commands) { - switch (commands[i]) { - case "--debug": - options.debug = true; - - // Open the DEV tool (need a SDK version of NW) - if (isSdkMode() /*&& isMainWin()*/) { - gui.Window.get().showDevTools(); - } - break; - case "--menu": - options.menu = true; - - break; - } - } -} - -/**** Re-routing console log ****/ -if (!isSdkMode() || !options.debug) { - var oldConsole = { - log: console.log, - debug: console.debug, - info: console.info, - warn: console.warn, - error: console.error, - } - if (debug) { - console.debug = function (message) { - process.stdout.write(clc.green("[DEBUG] ") + message + "\n"); - oldConsole.debug.apply(this, arguments); - }; - console.log = function(message) { - process.stdout.write(clc.blue("[CONSOLE] ") + message + "\n"); - oldConsole.log.apply(this, arguments); - } - } - console.info = function(message) { - process.stdout.write(clc.blue("[INFO] ") + message + "\n"); - oldConsole.info.apply(this, arguments); - }; - console.warn = function(message) { - process.stdout.write(clc.yellow("[WARN] ") + message + "\n"); - oldConsole.warn.apply(this, arguments); - }; - console.error = function(message) { - if (typeof message == "object") { - process.stderr.write(clc.red("[ERROR] ") + JSON.stringify(message) + "\n"); - } - else { - process.stderr.write(clc.red("[ERROR] ") + message + "\n"); - } - oldConsole.error.apply(this, arguments); - }; -} - - - -/**** Starting (main win) ****/ - -if (isMainWin()) { - //const nww = requireNodejs('nw'); - let settingsStr = window.localStorage.getItem('settings'); - let settings = (settingsStr && JSON.parse(settingsStr)); - const locale = (settings && settings.locale && settings.locale.id).split('-')[0] || 'en'; - console.debug("[NW] User home {" + HOME + "}"); - console.debug("[NW] Using locale {" + locale + "}"); - if (options.debug) console.info("[NW] Enabling debug mode (--debug)"); - if (options.menu) console.info("[NW] Enabling menu bar(--menu)"); - - /**** Menu bar ****/ - if (options.menu) { - var menuBar = new gui.Menu({ type: 'menubar' }); - - // File - var filemenu = new gui.Menu(); - let quitItem = new gui.MenuItem({ - label: I18N[locale].MENU.QUIT_ITEM, - click: function() { - console.log("[NW] Closing..."); - gui.App.closeAllWindows(); - },}); - filemenu.append(quitItem); - menuBar.append(new gui.MenuItem({ - label: I18N[locale].MENU.FILE, - submenu: filemenu - })); - - // Window - var winmenu = new gui.Menu(); - let newWinItem = new gui.MenuItem({ - label: I18N[locale].MENU.NEW_WINDOW_ITEM, - click: function() { - console.log("[NW] Opening new window..."); - gui.Window.open("cesium/index.html"); - },}); - winmenu.append(newWinItem); - - - // Window > Accounts - var accountMenu = new gui.Menu(); - let openAccountItem = new gui.MenuItem({ - label: I18N[locale].MENU.OPEN_ACCOUNT||'Wallet 1', - click: function() { - console.log("[NW] Opening wallet 1..."); - gui.Window.open("cesium/index.html", { - focus: true - }, - function(win){ - win.window.localStorage.setItem('pubkey', "38MEAZN68Pz1DTvT3tqgxx4yQP6snJCQhPqEFxbDk4aE"); - console.log("[NW] Loading wallet 1..."); - }); - },}); - accountMenu.append(openAccountItem); - winmenu.append(new gui.MenuItem({ - label: I18N[locale].MENU.ACCOUNTS||'Accounts', - submenu: accountMenu - })); - - menuBar.append(new gui.MenuItem({ - label: I18N[locale].MENU.WINDOW, - submenu: winmenu - })); - - gui.Window.get().menu = menuBar; - } - - - /**** Checking Cesium keyring file ****/ - let keyringRaw, keyring, keyPairOK; - let pubkey = settings && window.localStorage.getItem('pubkey'); - var rememberMe = (!settings && DEFAULT_CESIUM_SETTINGS.rememberMe) || settings.rememberMe == true; - var keyringFile = settings && settings.keyringFile || CESIUM_KEYRING; - if (rememberMe && fs.existsSync(keyringFile)) { - console.debug("[NW] Keyring file detected at {" + keyringFile + "}..."); - - keyringRaw = fs.readFileSync(keyringFile); - keyring = yaml.safeLoad(keyringRaw); - - keyPairOK = keyring.pub && keyring.sec && true; - if (!keyPairOK) { - console.warn("[NW] Invalid keyring file: missing 'pub' or 'sec' field! Skipping auto-login."); - // Store settings - settings = settings || DEFAULT_CESIUM_SETTINGS; - if (settings.keyringFile) { - delete settings.keyringFile; - window.localStorage.setItem('settings', JSON.stringify(settings)); - } - } else { - console.debug("[NW] Auto-login user on {" + keyring.pub + "}"); - window.localStorage.setItem('pubkey', keyring.pub); - const keepAuthSession = !settings || (settings.keepAuthIdle == 9999); - if (keepAuthSession) { - console.debug("[NW] Auto-authenticate on account (using keyring file)"); - window.sessionStorage.setItem('seckey', keyring.sec); - } - - // Store settings - settings = settings || DEFAULT_CESIUM_SETTINGS; - if (!settings.keyringFile || settings.keyringFile != keyringFile) { - settings.keyringFile = keyringFile; - window.localStorage.setItem('settings', JSON.stringify(settings)); - } - } - } else if (settings && settings.keyringFile) { - console.warn("[NW] Unable to found keyring file define in Cesium settings. Skipping auto-login"); - // Store settings - settings = settings || DEFAULT_CESIUM_SETTINGS; - if (settings.keyringFile) { - delete settings.keyringFile; - window.localStorage.setItem('settings', JSON.stringify(settings)); - } - } - - /**** Checking Duniter configuration files ****/ - - if (!keyPairOK && fs.existsSync(DUNITER_CONF) && fs.existsSync(DUNITER_KEYRING)) { - const duniterConf = requireNodejs(DUNITER_CONF); - keyringRaw = fs.readFileSync(DUNITER_KEYRING); - keyring = yaml.safeLoad(keyringRaw); - - console.log('Duniter conf = ', duniterConf); - console.log('Duniter keyring pubkey = ', keyring.pub); - - const local_host = duniterConf.ipv4 || duniterConf.ipv6; - const local_port = duniterConf.port; - - let keyPairOK = pubkey && true; - if (keyPairOK) { - console.log('Compte connecté dans Cesium. Comparaison avec celui du nœud local...') - keyPairOK = pubkey === keyring.pub; - if (!keyPairOK) { - console.log('Le compte Cesium est différent de celui du nœud.') - // Check is need to ask user to use node keyring - if (settings && settings.askLocalNodeKeyring === false) { - console.log("L'utilisateur a demander ultérieurement d'ignorer le basculement sur le nœud local."); - keyPairOK = true; - } - } else { - console.log('Compte Cesium déjà identique au nœud local.'); - - // Configuration de la clef privée, si autorisé dans les paramètres - const keepAuthSession = !settings || (settings.keepAuthIdle == 9999); - if (keepAuthSession) { - console.debug('Configuring Cesium secret key...'); - window.sessionStorage.setItem('seckey', keyring.sec); - } - } - } - if (duniterConf.currency === expectedCurrency - && (!keyPairOK - || (settings && settings.node && - (settings.node.host != local_host || settings.node.port != local_port)) - )) { - - - const confirmationMessage = (locale === 'fr') ? - 'Un nœud pour la monnaie ' + expectedCurrency + ' a été détecté sur cet ordinateur, voulez-vous que Cesium s\'y connecte ?' : - 'A node for currency ' + expectedCurrency + ' has been detected on this computer. Do you want Cesium to connect it?'; - - if (confirm(confirmationMessage)) { - - console.debug('Configuring Cesium on local node...'); - - // Generate settings, on local node (with node's keyring) - const keepAuthSession = !settings || (settings.keepAuthIdle == 9999); - settings = settings || DEFAULT_CESIUM_SETTINGS; - settings.node = { - "host": local_host, - "port": local_port - }; - settings.rememberMe = true; - settings.useLocalStorage = true; - if (keepAuthSession) { - settings.keepAuthIdle = 9999; - } - settings.plugins = settings.plugins || DEFAULT_CESIUM_SETTINGS.plugins; - settings.plugins.es = settings.plugins.es || DEFAULT_CESIUM_SETTINGS.plugins.es; - if (locale === "fr") { - settings.plugins.es.defaultCountry = "France"; - } - - // Store settings - window.localStorage.setItem('settings', JSON.stringify(settings)); - - // Store pubkey and seckey (if allowed) - window.localStorage.setItem('pubkey', keyring.pub); - if (keepAuthSession) { - console.debug('Configuring Cesium secret key...'); - window.sessionStorage.setItem('seckey', keyring.sec); - } - } - - // Do Not ask again - else { - console.debug('User not need to connect on local node. Configuring Cesium to remember this choice...'); - settings = settings || DEFAULT_CESIUM_SETTINGS; - settings.askLocalNodeKeyring = false; - window.localStorage.setItem('settings', JSON.stringify(settings)); - } - } - - } - - -} diff --git a/arch/osx/package.json b/arch/osx/package.json deleted file mode 100644 index 8cfb6ba810f1c1c4eeed31e2c37601d0c15b8b33..0000000000000000000000000000000000000000 --- a/arch/osx/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "cesium", - "main": "cesium/index.html", - "license": "AGPL-3.0", - "window": { - "id": "cesium", - "icon": "cesium/img/logo.png", - "title": "v0.12.7", - "width": 1300, - "height": 800, - "min_width": 750, - "min_height": 400 - }, - "dependencies": { - "bs58": "^4.0.1", - "cli-color": "^1.4.0", - "js-yaml": "^3.8.4" - } -} diff --git a/install.sh b/install.sh index 8728f4c6fd1e546ab03dcb020c09db115ad30893..489d4a6cb0780031b6083542d0461d48e3381444 100755 --- a/install.sh +++ b/install.sh @@ -1,12 +1,13 @@ #!/bin/bash -ROOT_DIR=$PWD -TEMP_DIR=$PWD/tmp +PROJECT_DIR=$(pwd) +DOWNLOADS_DIR=${PROJECT_DIR}/downloads NW_VERSION=0.42.2 #NW_BASENAME=nwjs NW_BASENAME=nwjs-sdk CHROMIUM_MAJOR_VERSION=78 -CESIUM_DEFAULT_VERSION=1.6.0 +CESIUM_DEFAULT_VERSION=1.6.7 +NODE_VERSION=10 # Check first arguments = version if [[ $1 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ ]]; @@ -14,9 +15,9 @@ then VERSION="$1" echo "Using Cesium version: $VERSION" else - if [[ -f $ROOT_DIR/src/nw/cesium/manifest.json ]]; + if [[ -f ${PROJECT_DIR}/src/nw/cesium/manifest.json ]]; then - VERSION=`grep -oP "version\": \"\d+.\d+.\d+((a|b)[0-9]+)?\"" $ROOT_DIR/src/nw/cesium/manifest.json | grep -oP "\d+.\d+.\d+((a|b)[0-9]+)?"` + VERSION=`grep -oP "version\": \"\d+.\d+.\d+((a|b)[0-9]+)?\"" ${PROJECT_DIR}/src/nw/cesium/manifest.json | grep -oP "\d+.\d+.\d+((a|b)[0-9]+)?"` fi if [[ $VERSION =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ ]]; @@ -28,90 +29,92 @@ else fi fi -# Force nodejs version to 6 +# Force nodejs version to 10 if [[ -d "${NVM_DIR}" ]]; then . ${NVM_DIR}/nvm.sh - nvm install 13 + nvm install ${NODE_VERSION} else echo "nvm (Node version manager) not found (directory NVM_DIR not defined). Please install nvm, and retry" exit 1 fi +# Install Yarn +npm install -g yarn + # Install NW.js -if [[ ! -f "${ROOT_DIR}/src/nw/nw" ]]; -then - mkdir -p "${TEMP_DIR}" && cd "${TEMP_DIR}" || exit 1 - rm -rf ${TEMP_DIR:?}/* || exit 1 - cd "${TEMP_DIR}" || exit 1 - wget http://dl.nwjs.io/v${NW_VERSION}/${NW_BASENAME}-v${NW_VERSION}-linux-x64.tar.gz +if [[ ! -f "${PROJECT_DIR}/www/nw" ]]; then + echo "--- Installing NWJS ${NW_VERSION}..." + mkdir -p "${DOWNLOADS_DIR}" && cd "${DOWNLOADS_DIR}" || exit 1 + cd "${DOWNLOADS_DIR}" || exit 1 + if [[ ! -f "${NW_BASENAME}-v${NW_VERSION}-linux-x64.tar.gz" ]]; then + wget http://dl.nwjs.io/v${NW_VERSION}/${NW_BASENAME}-v${NW_VERSION}-linux-x64.tar.gz + [[ $? -ne 0 ]] && exit 1 + fi + + # Uncompress archive tar xvzf ${NW_BASENAME}-v${NW_VERSION}-linux-x64.tar.gz || exit 1 - cp -rf ${NW_BASENAME}-v${NW_VERSION}-linux-x64/* "${ROOT_DIR}/src/nw" && rm -rf ${NW_BASENAME}-v${NW_VERSION}-linux-x64 || exit 1 + + # Copy to ./www + mkdir -p "${PROJECT_DIR}/www" + cp -rf ${NW_BASENAME}-v${NW_VERSION}-linux-x64/* "${PROJECT_DIR}/www" && rm -rf ${NW_BASENAME}-v${NW_VERSION}-linux-x64 || exit 1 rm ${NW_BASENAME}-v${NW_VERSION}-linux-x64.tar.gz || exit 1 - rmdir nw # Check NW version else - cd "${ROOT_DIR}/src/nw" + cd "${PROJECT_DIR}/www" NW_ACTUAL_VERSION=$(./nw --version | grep nwjs | awk '{print $2}') echo "Using Chromium version: ${NW_ACTUAL_VERSION}" - CHROMIUM_ACTUAL_MAJOR_VERSION=$(echo ${NW_ACTUAL_VERSION} | awk '{split($0, array, ".")} END{print array[1]}') - cd "${ROOT_DIR}" + CHROMIUM_ACTUAL_MAJOR_VERSION=$(echo "${NW_ACTUAL_VERSION}" | awk '{split($0, array, ".")} END{print array[1]}') if [[ ${CHROMIUM_ACTUAL_MAJOR_VERSION} -ne ${CHROMIUM_MAJOR_VERSION} ]]; then echo "Bad Chromium major version: ${CHROMIUM_ACTUAL_MAJOR_VERSION}. Expected version ${CHROMIUM_MAJOR_VERSION}." - echo " - try to remove file '$ROOT_DIR/src/nw/nw', then relaunch the script" + echo " - try to remove file '${PROJECT_DIR}/www/nw', then relaunch the script" + cd "${PROJECT_DIR}" exit 1 fi fi -# Instal deps -cd "${ROOT_DIR}/src/nw" -npm install -g yarn + +# Copy sources +echo "--- Copying sources from ./src to ./www" +cd "${PROJECT_DIR}/www/" +cp -rf ${PROJECT_DIR}/src/* . +cp -f ${PROJECT_DIR}/LICENSE LICENSE.txt + +# Install dependencies +echo "--- Install dependencies to ./www/node_modules" yarn # Remove old Cesium version -if [[ -f $ROOT_DIR/src/nw/cesium/index.html ]]; +if [[ -f ${PROJECT_DIR}/www/cesium/index.html ]]; then - OLD_VERSION=$(grep -oP "version\": \"\d+.\d+.\d+((a|b)[0-9]+)?\"" $ROOT_DIR/src/nw/cesium/manifest.json | grep -oP "\d+.\d+.\d+((a|b)[0-9]+)?") + OLD_VERSION=$(grep -oP "version\": \"\d+.\d+.\d+((a|b)[0-9]+)?\"" ${PROJECT_DIR}/www/cesium/manifest.json | grep -oP "\d+.\d+.\d+((a|b)[0-9]+)?") if [[ ! "$VERSION" = "$OLD_VERSION" ]]; then - echo "Removing previous version ${OLD_VERSION}..." - rm -rf $ROOT_DIR/src/nw/cesium/dist_* - rm -rf $ROOT_DIR/src/nw/cesium/fonts - rm -rf $ROOT_DIR/src/nw/cesium/img - rm -rf $ROOT_DIR/src/nw/cesium/lib - rm -rf $ROOT_DIR/src/nw/cesium/api - rm -rf $ROOT_DIR/src/nw/cesium/license - rm -rf $ROOT_DIR/src/nw/cesium/*.html - rm -rf $ROOT_DIR/src/nw/cesium/manifest.json - rm -rf $ROOT_DIR/src/nw/cesium/config.js + echo "--- Removing old Cesium v${OLD_VERSION}..." + rm -rf ${PROJECT_DIR}/www/cesium fi fi # Install Cesium web -if [[ ! -f $ROOT_DIR/src/nw/cesium/index.html ]]; then - echo "Downloading Cesium ${VERSION}..." - - mkdir -p "${TEMP_DIR}" && cd "${TEMP_DIR}" || exit 1 - mkdir -p "${TEMP_DIR}/cesium_unzip" && cd "${TEMP_DIR}/cesium_unzip" || exit 1 - wget "https://github.com/duniter/cesium/releases/download/v${VERSION}/cesium-v${VERSION}-web.zip" - if [[ ! $? -eq 0 ]]; then - echo "Could not download Cesium web release !" - exit 1; +if [[ ! -f ${PROJECT_DIR}/www/cesium/index.html ]]; then + echo "--- Downloading Cesium v${VERSION}..." + + mkdir -p "${DOWNLOADS_DIR}" && cd "${DOWNLOADS_DIR}" || exit 1 + if [[ ! -f "${cesium-v${VERSION}-web.zip}" ]]; then + wget "https://github.com/duniter/cesium/releases/download/v${VERSION}/cesium-v${VERSION}-web.zip" + if [[ $? -ne 0 ]]; then + echo "Could not download Cesium web release !" + exit 1; + fi fi - unzip -o "cesium-v${VERSION}-web.zip" -d "${TEMP_DIR}/cesium_unzip" || exit 1 - rm "cesium-v${VERSION}-web.zip" + mkdir -p "${PROJECT_DIR}/www/cesium" || exit 1 + unzip -o "cesium-v${VERSION}-web.zip" -d "${PROJECT_DIR}/www/cesium" || exit 1 - # Add node.js file into HTML files - cd ${TEMP_DIR}/cesium_unzip || exit 1 - sed -i 's/(<script src="config.js"[^>]+><\/script>)/$1 \n<script src="node.js"><\/script>/' index*.html || exit 1 + # Add cesium-desktop.js file into HTML files + cd "${PROJECT_DIR}/www/cesium" || exit 1 + sed -i 's/<script src="config.js"[^>]*><\/script>/<script src="config.js"><\/script>\n\t<script src="..\/cesium-desktop.js"><\/script>/g' index*.html || exit 1 - mv -f * ${ROOT_DIR}/src/nw/cesium/ || exit 1 - if [[ $? -ne 0 ]]; then - exit 1 - fi - cd .. - rmdir cesium_unzip fi -cd ${ROOT_DIR} || exit 1 +cd ${PROJECT_DIR} || exit 1 diff --git a/package.json b/package.json index ed9ee4e371b42b9dfbc153e4da30e7105fa154f1..6f5d11c61e32843adc7db203fbabd5c4db985239 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,25 @@ { + "name": "cesium-desktop", "license": "AGPL-3.0", + "scripts": { + "clean": "trash www", + "start": "./run.sh", + "build": "./release.sh" + }, + "keywords": [ + "duniter", + "cesium", + "g1", + "desktop", + "angularjs", + "crypto-currency" + ], + "readmeFilename": "README.md", "dependencies": { "bs58": "^4.0.1", - "co": "^4.6.0", - "js-yaml": "^3.13.1", "cli-color": "^2.0.0", + "js-yaml": "^3.13.1", + "co": "^4.6.0", "request": "^2.88.2", "request-promise": "^4.2.5", "stringstream": "^0.0.6" diff --git a/run.sh b/run.sh index fe3eab1e51cd919dce4c40f627526a8b7181ddf8..de4ddc55b1846b5ac31f28b8d262015669827817 100755 --- a/run.sh +++ b/run.sh @@ -1,35 +1,31 @@ #!/bin/bash -ROOT=`pwd` +PROJECT_DIR=$(pwd) VERSION=$1 if [[ "${VERSION}" = "DEV" ]]; then # Installing default version ./install.sh - if [[ ! $? -eq 0 ]]; then - exit -1; - fi + [[ ! $? -eq 0 ]] && exit 1 # Copying DEV files - if [[ -d "${ROOT}/../../www/dist" ]]; then + if [[ -d "${PROJECT_DIR}/../../www/dist" ]]; then echo "Copying DEV files..." - mkdir -p ${ROOT}/src/nw/cesium/dist - mkdir -p ${ROOT}/src/nw/cesium/js - cp -rf ${ROOT}/../../www/dist/dist_js ${ROOT}/src/nw/cesium/dist - cp -rf ${ROOT}/../../www/dist/dist_css ${ROOT}/src/nw/cesium/dist - cp -rf ${ROOT}/../../www/js/vendor ${ROOT}/src/nw/cesium/js - cp -rf ${ROOT}/../../www/css ${ROOT}/src/nw/cesium - cp -rf ${ROOT}/../../www/img ${ROOT}/src/nw/cesium - cp -rf ${ROOT}/../../www/lib ${ROOT}/src/nw/cesium - cp -rf ${ROOT}/../../www/license ${ROOT}/src/nw/cesium - cp -f ${ROOT}/../../www/index.html ${ROOT}/src/nw/cesium + mkdir -p ${PROJECT_DIR}/www/cesium + mkdir -p ${PROJECT_DIR}/www/cesium/js + cp -rf ${PROJECT_DIR}/../../www/dist/dist_js ${PROJECT_DIR}/www/cesium/dist + cp -rf ${PROJECT_DIR}/../../www/dist/dist_css ${PROJECT_DIR}/www/cesium/dist + cp -rf ${PROJECT_DIR}/../../www/js/vendor ${PROJECT_DIR}/www/cesium/js + cp -rf ${PROJECT_DIR}/../../www/css ${PROJECT_DIR}/www/cesium + cp -rf ${PROJECT_DIR}/../../www/img ${PROJECT_DIR}/www/cesium + cp -rf ${PROJECT_DIR}/../../www/lib ${PROJECT_DIR}/www/cesium + cp -rf ${PROJECT_DIR}/../../www/license ${PROJECT_DIR}/www/cesium + cp -f ${PROJECT_DIR}/../../www/index.html ${PROJECT_DIR}/www/cesium fi else ./install.sh $1 - if [[ ! $? -eq 0 ]]; then - exit 1; - fi + [[ ! $? -eq 0 ]] && exit 1 fi -./src/nw/nw $2 $3 +./www/nw $2 $3 diff --git a/scripts/build.sh b/scripts/build.sh index ef722c15fc499358c63ef18c5501b7263100764c..c43f60bcd5d8a496a4f630ee57b283a120763488 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -9,10 +9,8 @@ make) cd arch/linux if [[ ! -f "cesium-desktop-v$TAG-linux-x64.deb" ]]; then [[ $? -eq 0 ]] && echo ">> Copying Cesium Desktop sources..." - [[ $? -eq 0 ]] && cp ../../src/nw/yarn.lock ./ - [[ $? -eq 0 ]] && cp ../../src/nw/package.json ./ - [[ $? -eq 0 ]] && cp ../../src/nw/cesium-desktop.js ./ - [[ $? -eq 0 ]] && cp ../../src/nw/splash.html ./ + [[ $? -eq 0 ]] && cp ../../src/* ./ + [[ $? -eq 0 ]] && cp ../../LICENSE ./LICENSE.txt [[ $? -eq 0 ]] && echo ">> Starting Vagrant Ubuntu VM..." [[ $? -eq 0 ]] && vagrant up [[ $? -eq 0 ]] && echo ">> VM: building Cesium..." @@ -33,10 +31,8 @@ make) cd arch/windows if [[ ! -f "cesium-desktop-v$TAG-windows-x64.exe" ]]; then [[ $? -eq 0 ]] && echo ">> Copying Cesium Desktop sources..." - [[ $? -eq 0 ]] && cp ../../src/nw/package.json ./ - [[ $? -eq 0 ]] && cp ../../src/nw/LICENSE.txt ./ - [[ $? -eq 0 ]] && cp ../../src/nw/cesium-desktop.js ./ - [[ $? -eq 0 ]] && cp ../../src/nw/splash.html ./ + [[ $? -eq 0 ]] && cp ../../src/* ./ + [[ $? -eq 0 ]] && cp ../../LICENSE ./LICENSE.txt # Win build need a copy of the web asset (download in build.bat failed) [[ $? -eq 0 ]] && cp "../../downloads/cesium-v$TAG-web.zip" ./ # Download box locally @@ -60,10 +56,9 @@ make) cd arch/osx if [[ ! -f "cesium-desktop-v$TAG-osx-x64.zip" ]]; then [[ $? -eq 0 ]] && echo ">> Copying Cesium Desktop sources..." - [[ $? -eq 0 ]] && cp ../../src/nw/package.json ./ - [[ $? -eq 0 ]] && cp ../../src/nw/cesium-desktop.js ./ - [[ $? -eq 0 ]] && cp ../../src/nw/splash.html ./ - # OSx need a copy of the web asset (download in build-osx.sh failed) + [[ $? -eq 0 ]] && cp ../../src/* ./ + [[ $? -eq 0 ]] && cp ../../LICENSE ./LICENSE.txt + # Copy web asset (download in build-osx.sh failed) [[ $? -eq 0 ]] && cp "../../downloads/cesium-v$TAG-web.zip" ./ # Download box locally #if [[ $? -eq 0 && ! -f ./osx-10.14.box ]]; then @@ -91,9 +86,12 @@ make) echo ">> OSx binaries already built. Ready for upload." fi ;; -ios) + ios) cd arch/osx if [[ ! -f "cesium-v$TAG-ios.zip" ]]; then + [[ $? -eq 0 ]] && echo ">> Copying Cesium Desktop sources..." + [[ $? -eq 0 ]] && cp ../../src/* ./ + [[ $? -eq 0 ]] && cp ../../LICENSE ./LICENSE.txt [[ $? -eq 0 ]] && echo ">> Starting Vagrant OSx VM..." [[ $? -eq 0 ]] && vagrant up --provision [[ $? -eq 0 ]] && echo ">> Building Cesium for iOS..." diff --git a/src/nw/cesium-desktop.js b/src/cesium-desktop.js similarity index 79% rename from src/nw/cesium-desktop.js rename to src/cesium-desktop.js index 9cf87b1f700408aca284f321a1c996ec1acac474..43e7c67ad6f5ee9d9ec2d9dabb00057d543bcc27 100644 --- a/src/nw/cesium-desktop.js +++ b/src/cesium-desktop.js @@ -80,13 +80,13 @@ const I18N = { const win = gui && gui.Window && gui.Window.get(); function isSdkMode () { - return gui && (window.navigator.plugins.namedItem('Native Client') !== null) && win.showDevTools; + return gui && typeof win.showDevTools === 'function'; } -function isMainWin() { +function isMainWin(win) { return win && win.title === "Cesium" && true; } -function isSplashScreen() { - return (win && win.title === ""); +function isSplashScreen(win) { + return (win && win.title === "Cesium loading..."); } /** @@ -138,7 +138,7 @@ function consoleToStdout(options) { const argument = arguments[i]; if (typeof argument === "object" && argument.stack) { - process.stdout.write(JSON.stringify(argument.stack)); + process.stdout.write(argument.stack); } else if (typeof argument === "string") { process.stdout.write(argument); @@ -185,7 +185,10 @@ function initLogger(options) { options = options || getArgs(); if (options.debug) { - if (!options.sdk || options.menu) { + if (options.sdk && options.menu) { + // SDK enable: not need to redirect debug + } + else { // Re-routing console log consoleToStdout(options); } @@ -196,10 +199,23 @@ function initLogger(options) { } } +function openDebugger(subWin) { + subWin = subWin || win; + if (isSdkMode()) { + try { + console.info("[desktop] Opening debugger..."); + subWin.showDevTools(); + } + catch(err) { + console.error("[desktop] Cannot open debugger:", err); + } + } +} + function loadSettings(options) { if (options && options.settings) return; // Skip, already filled - console.debug("[splash] Getting settings from the local storage..."); + console.debug("[desktop] Getting settings from the local storage..."); let settingsStr = window.localStorage.getItem('settings'); options.settings = (settingsStr && JSON.parse(settingsStr)); @@ -222,7 +238,7 @@ function addMenu(subWin, options) { } const locale = options.locale || 'en'; - console.debug("[splash] Adding menu..."); + console.debug("[desktop] Adding menu..."); var menuBar = new gui.Menu({ type: 'menubar' }); @@ -231,7 +247,7 @@ function addMenu(subWin, options) { let quitItem = new gui.MenuItem({ label: I18N[locale].MENU.QUIT_ITEM, click: function() { - console.info("[splash] Closing..."); + console.info("[desktop] Closing..."); gui.App.closeAllWindows(); },}); filemenu.append(quitItem); @@ -262,7 +278,7 @@ function addMenu(subWin, options) { const pubkey = '38MEAZN68Pz1DTvT3tqgxx4yQP6snJCQhPqEFxbDk4aE'; // TODO: get it from storage ? - console.info("[splash] Opening new window, for wallet {"+ pubkey.substr(0,8) +"}..."); + console.info("[desktop] Opening new window, for wallet {"+ pubkey.substr(0,8) +"}..."); openSecondaryWindow({ id: 'cesium-' + pubkey, @@ -284,10 +300,8 @@ function addMenu(subWin, options) { if (options.sdk) { let debugWinItem = new gui.MenuItem({ label: I18N[locale].MENU.OPEN_DEBUG_TOOL, - click: function() { - console.info("[splash] Opening debugger..."); - win.showDevTools(); - },}); + click: () => openDebugger() + }); winmenu.append(debugWinItem); } @@ -303,7 +317,7 @@ function addMenu(subWin, options) { } function prepareSettings(options) { - console.info("[splash] Preparing settings..."); + console.info("[desktop] Preparing settings..."); options = options || getArgs(); let settings = options.settings; @@ -315,14 +329,14 @@ function prepareSettings(options) { const rememberMe = (!settings && DEFAULT_CESIUM_SETTINGS.rememberMe) || settings.rememberMe == true; const keyringFile = settings && settings.keyringFile || CESIUM_KEYRING; if (rememberMe && fs.existsSync(keyringFile)) { - console.debug("[splash] Keyring file detected at {" + keyringFile + "}..."); + console.debug("[desktop] Keyring file detected at {" + keyringFile + "}..."); keyringRaw = fs.readFileSync(keyringFile); keyring = yaml.safeLoad(keyringRaw); keyPairOK = keyring.pub && keyring.sec && true; if (!keyPairOK) { - console.warn("[splash] Invalid keyring file: missing 'pub' or 'sec' field! Skipping auto-login."); + console.warn("[desktop] Invalid keyring file: missing 'pub' or 'sec' field! Skipping auto-login."); // Store settings settings = settings || DEFAULT_CESIUM_SETTINGS; if (settings.keyringFile) { @@ -330,23 +344,23 @@ function prepareSettings(options) { window.localStorage.setItem('settings', JSON.stringify(settings)); } } else { - console.debug("[splash] Auto-login user on {" + keyring.pub + "}"); + console.debug("[desktop] Auto-login user on {" + keyring.pub + "}"); window.localStorage.setItem('pubkey', keyring.pub); const keepAuthSession = !settings || (settings.keepAuthIdle == 9999); if (keepAuthSession) { - console.debug("[splash] Auto-authenticate on account (using keyring file)"); + console.debug("[desktop] Auto-authenticate on account (using keyring file)"); window.sessionStorage.setItem('seckey', keyring.sec); } // Store settings settings = settings || DEFAULT_CESIUM_SETTINGS; - if (!settings.keyringFile || settings.keyringFile != keyringFile) { + if (!settings.keyringFile || settings.keyringFile !== keyringFile) { settings.keyringFile = keyringFile; window.localStorage.setItem('settings', JSON.stringify(settings)); } } } else if (settings && settings.keyringFile) { - console.warn("[splash] Unable to found keyring file define in Cesium settings. Skipping auto-login"); + console.warn("[desktop] Unable to found keyring file define in Cesium settings. Skipping auto-login"); // Store settings settings = settings || DEFAULT_CESIUM_SETTINGS; if (settings.keyringFile) { @@ -362,30 +376,30 @@ function prepareSettings(options) { keyringRaw = fs.readFileSync(DUNITER_KEYRING); keyring = yaml.safeLoad(keyringRaw); - console.debug('[splash] Checking Duniter node config, at ' + DUNITER_CONF + ':', duniterConf); - console.debug('[splash] Checking Duniter node pubkey, at ' + DUNITER_KEYRING+ ':', keyring.pub); + console.debug('[desktop] Checking Duniter node config, at ' + DUNITER_CONF + ':', duniterConf); + console.debug('[desktop] Checking Duniter node pubkey, at ' + DUNITER_KEYRING+ ':', keyring && keyring.pub); - const local_host = duniterConf.ipv4 || duniterConf.ipv6; + const local_host = (duniterConf.ipv4 || duniterConf.ipv6); const local_port = duniterConf.port; let keyPairOK = pubkey && true; if (keyPairOK) { - console.debug('[splash] Detected logged account: comparing with the local Duniter node...') + console.debug('[desktop] Detected logged account: comparing with the local Duniter node...') keyPairOK = pubkey === keyring.pub; if (!keyPairOK) { - console.debug('[splash] Logged account not same as Duniter node.') + console.debug('[desktop] Logged account not same as Duniter node.') // Check is need to ask user to use node keyring if (settings && settings.askLocalNodeKeyring === false) { - console.debug("[splash] Do NOT ask to use local node (user ask to ignore this feature)"); + console.debug("[desktop] Do NOT ask to use local node (user ask to ignore this feature)"); keyPairOK = true; } } else { - console.debug('[splash] Same account as local node!'); + console.debug('[desktop] Same account as local node!'); // Configuration de la clef privée, si autorisé dans les paramètres const keepAuthSession = !settings || (settings.keepAuthIdle == 9999); if (keepAuthSession) { - console.debug('[splash] Storing Node keypair to session storage...'); + console.debug('[desktop] Storing Node keypair to session storage...'); window.sessionStorage.setItem('seckey', keyring.sec); } } @@ -402,7 +416,7 @@ function prepareSettings(options) { if (confirm(confirmationMessage)) { - console.debug('[splash] Make Cesium works on local node...'); + console.debug('[desktop] Make Cesium works on local node...'); // Generate settings, on local node (with node's keyring) const keepAuthSession = !settings || (settings.keepAuthIdle == 9999); @@ -429,14 +443,14 @@ function prepareSettings(options) { // Store pubkey and seckey (if allowed) window.localStorage.setItem('pubkey', keyring.pub); if (keepAuthSession) { - console.debug('[splash] Configuring Cesium secret key...'); + console.debug('[desktop] Configuring Cesium secret key...'); window.sessionStorage.setItem('seckey', keyring.sec); } } // Do Not ask again else { - console.debug('[splash] User not need to connect on local node. Configuring Cesium to remember this choice...'); + console.debug('[desktop] User not need to connect on local node. Configuring Cesium to remember this choice...'); settings = settings || DEFAULT_CESIUM_SETTINGS; settings.askLocalNodeKeyring = false; window.localStorage.setItem('settings', JSON.stringify(settings)); @@ -459,7 +473,7 @@ function openNewWindow(options, callback) { focus: true, ...options }; - console.debug("[splash] Opening window {id: '"+ options.id + "', title: '"+ options.title +"'} ..."); + console.debug("[desktop] Opening window {id: '"+ options.id + "', title: '"+ options.title +"'} ..."); gui.Window.open('cesium/index.html', { id: options.id, title: options.title, @@ -474,10 +488,6 @@ function openNewWindow(options, callback) { } function openMainWindow(options, callback) { - options = { - id: "cesium", - ...options - }; openNewWindow({ id: "cesium", ...options @@ -498,26 +508,37 @@ function openSecondaryWindow(options, callback) { function startApp(options) { options = options || getArgs(); - if (options.debug && options.sdk) { - win.showDevTools(); + if (options.debug) { + openDebugger(win); } try { - console.info("[splash] Launching Cesium...", options); + console.info("[desktop] Launching Cesium...", options); loadSettings(options); - console.info("[splash] User home: ", options.home); - console.info("[splash] User locale:", options.locale); + + console.info("[desktop] User home: ", options.home); + console.info("[desktop] User locale:", options.locale); prepareSettings(options); openMainWindow(options); + + setTimeout(() => win.close(), 1000); } catch (err) { - console.error("[splash] Error while trying to launch Cesium: " + (err && err.message || err || ''), err); + console.error("[desktop] Error while trying to launch Cesium: " + (err && err.message || err || ''), err); + + if (options.debug && options.sdk) { + // Keep open, if debugger open + } + else { + // Close the splash screen + setTimeout(() => win.close()); + } } - setTimeout(() => win.close(), 500); + } // -- MAIN -- @@ -528,15 +549,22 @@ const options = getArgs(); initLogger(options); // Splash screen: start the app -if (isSplashScreen()) { +if (isSplashScreen(win)) { setTimeout(() => startApp(options), 1000); } // Main window: add menu -else if (isMainWin()) { +else if (isMainWin(win)) { if (options.menu) { addMenu(win, options); } + + if (options.debug) { + openDebugger(win); + } +} +else { + console.warn("[desktop] Unknown window title: " + (win && win.title || 'undefined')); } diff --git a/src/nw/package.json b/src/nw/package.json deleted file mode 100644 index d03b4852d1cf5518d303082c101483d481055f23..0000000000000000000000000000000000000000 --- a/src/nw/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "cesium", - "main": "splash.html", - "license": "AGPL-3.0", - "window": { - "id": "splash", - "frame": false - } -} diff --git a/src/package.json b/src/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4da52dea65063d98c8f9320cc1e8c83849360ba5 --- /dev/null +++ b/src/package.json @@ -0,0 +1,25 @@ +{ + "name": "cesium", + "main": "splash.html", + "license": "AGPL-3.0", + "window": { + "id": "splash", + "icon": "cesium/img/logo.png", + "min_width": 640, + "min_height": 480, + "max_width": 640, + "max_height": 480, + "position": "center", + "frame": false, + "title": "Cesium loading..." + }, + "dependencies": { + "bs58": "^4.0.1", + "cli-color": "^2.0.0", + "js-yaml": "^3.13.1", + "co": "^4.6.0", + "request": "^2.88.2", + "request-promise": "^4.2.5", + "stringstream": "^0.0.6" + } +} diff --git a/src/nw/splash.html b/src/splash.html similarity index 91% rename from src/nw/splash.html rename to src/splash.html index a7f305e3a6b5496a859c597648c390a4fdce2e90..838bc51819281e5add242feec93db1d5616b5321 100644 --- a/src/nw/splash.html +++ b/src/splash.html @@ -19,8 +19,8 @@ <script src="cesium-desktop.js"></script> - <!-- Preload JS files here --> + <!-- Preload JS files here <script src="cesium/dist_js/cesium.js" async></script> - <script src="cesium/dist_js/vendor.js" async></script> + <script src="cesium/dist_js/vendor.js" async></script>--> </body> </html> diff --git a/src/yarn.lock b/src/yarn.lock new file mode 100644 index 0000000000000000000000000000000000000000..f3573298589a08b4e605c75a94ba2339e909b092 --- /dev/null +++ b/src/yarn.lock @@ -0,0 +1,532 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +ajv@^6.5.5: + version "6.12.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd" + integrity sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-regex@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e" + integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug== + +base-x@^3.0.2: + version "3.0.8" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.8.tgz#1e1106c2537f0162e8b52474a557ebb09000018d" + integrity sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA== + dependencies: + safe-buffer "^5.0.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +bluebird@^3.5.0: + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== + +bs58@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= + dependencies: + base-x "^3.0.2" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +cli-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-2.0.0.tgz#11ecfb58a79278cf6035a60c54e338f9d837897c" + integrity sha512-a0VZ8LeraW0jTuCkuAGMNufareGHhyZU9z8OGsW0gXd1hZGi1SRuNRXdbGkraBBKnhyUhyebFWnRbp+dIn0f0A== + dependencies: + ansi-regex "^2.1.1" + d "^1.0.1" + es5-ext "^0.10.51" + es6-iterator "^2.0.3" + memoizee "^0.4.14" + timers-ext "^0.1.7" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +d@1, d@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" + integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== + dependencies: + es5-ext "^0.10.50" + type "^1.0.1" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +es5-ext@^0.10.35, es5-ext@^0.10.45, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.51, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: + version "0.10.53" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" + integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q== + dependencies: + es6-iterator "~2.0.3" + es6-symbol "~3.1.3" + next-tick "~1.0.0" + +es6-iterator@^2.0.3, es6-iterator@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-symbol@^3.1.1, es6-symbol@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" + integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== + dependencies: + d "^1.0.1" + ext "^1.1.2" + +es6-weak-map@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" + integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== + dependencies: + d "1" + es5-ext "^0.10.46" + es6-iterator "^2.0.3" + es6-symbol "^3.1.1" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +event-emitter@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + integrity sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk= + dependencies: + d "1" + es5-ext "~0.10.14" + +ext@^1.1.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" + integrity sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A== + dependencies: + type "^2.0.0" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" + integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +is-promise@^2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" + integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +js-yaml@^3.13.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +lodash@^4.17.15: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + +lru-queue@0.1: + version "0.1.0" + resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" + integrity sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM= + dependencies: + es5-ext "~0.10.2" + +memoizee@^0.4.14: + version "0.4.14" + resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.4.14.tgz#07a00f204699f9a95c2d9e77218271c7cd610d57" + integrity sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg== + dependencies: + d "1" + es5-ext "^0.10.45" + es6-weak-map "^2.0.2" + event-emitter "^0.3.5" + is-promise "^2.1" + lru-queue "0.1" + next-tick "1" + timers-ext "^0.1.5" + +mime-db@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" + integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.27" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" + integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== + dependencies: + mime-db "1.44.0" + +next-tick@1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" + integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== + +next-tick@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" + integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +psl@^1.1.28: + version "1.8.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" + integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== + +punycode@^2.1.0, punycode@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +request-promise-core@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.3.tgz#e9a3c081b51380dfea677336061fea879a829ee9" + integrity sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ== + dependencies: + lodash "^4.17.15" + +request-promise@^4.2.5: + version "4.2.5" + resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.5.tgz#186222c59ae512f3497dfe4d75a9c8461bd0053c" + integrity sha512-ZgnepCykFdmpq86fKGwqntyTiUrHycALuGggpyCZwMvGaZWgxW6yagT0FHkgo5LzYvOaCNvxYwWYIjevSH1EDg== + dependencies: + bluebird "^3.5.0" + request-promise-core "1.1.3" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" + +request@^2.88.2: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +safe-buffer@^5.0.1, safe-buffer@^5.1.2: + version "5.2.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" + integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + +safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +stealthy-require@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= + +stringstream@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.6.tgz#7880225b0d4ad10e30927d167a1d6f2fd3b33a72" + integrity sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA== + +timers-ext@^0.1.5, timers-ext@^0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/timers-ext/-/timers-ext-0.1.7.tgz#6f57ad8578e07a3fb9f91d9387d65647555e25c6" + integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== + dependencies: + es5-ext "~0.10.46" + next-tick "1" + +tough-cookie@^2.3.3, tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +type@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" + integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== + +type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/type/-/type-2.0.0.tgz#5f16ff6ef2eb44f260494dae271033b29c09a9c3" + integrity sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow== + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0"