From cedfdcee8d9be453cc1422c3e44ba032c4f5596b Mon Sep 17 00:00:00 2001 From: bandhavya Date: Mon, 12 Jul 2021 16:02:11 +0530 Subject: [PATCH 01/49] Changed few references to reactnative --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3c0c81e..5f10e9e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ wm-reactnative android [additional_arguments] |                   **Argument**                   | **Description** | |--|--| -| **src_dir** | **DEFAULT:** current working directory.
Path to the reactnative zip (or) path to the reactnative project folder. | +| **src_dir** | **DEFAULT:** current working directory.
Path to the reactnative expo zip (or) path to the reactnative expo project folder. | |**\-\-appId:** application id.| | **\-\-localrnruntimepath** |**OPTIONAL:** local app-rn-runtime path | |**\-\-dest**|**OPTIONAL:** directory where the app has to be copied and built. If it is not specified then .wm-reactnative-cli folder inside the home directory, will contain the build folders | @@ -45,7 +45,7 @@ wm-reactnative build android "/path/to/src" --appId="app_id" ~~~ ### Example 2 ~~~ -wm-cordova build android "/path/to/src" \ +wm-reactnative build android "/path/to/src" \ --dest="/path/to/dest" \ --aKeyStore="/path/to/file.keystore" \ --aStorePassword="store_password" \ @@ -73,7 +73,7 @@ wm-cordova build android "/path/to/src" \ - For development build, development certificate and development provisioning file are required. - For production build, distribution certificate and distribution provisioning file are required. -**NOTE:** Before building an app, please make sure that neither iPhone nor iPad is not connected to Mac. This is open [issue](https://github.com/apache/cordova-ios/issues/420) on cordova-ios. +**NOTE:** Before building an app, please make sure that neither iPhone nor iPad is not connected to Mac. ### Command @@ -82,7 +82,7 @@ wm-reactnative build ios [additional_arguments] |                   **Argument**                     | **Description** | |--|--| -| **src_dir** | **DEFAULT:** current working directory.
Path to the cordova zip (or) path to the cordova project folder. | +| **src_dir** | **DEFAULT:** current working directory.
Path to the reactnative expo zip (or) path to the reactnative expo project folder. | |**\-\-appId:** application id.| | **\-\-localrnruntimepath** |**OPTIONAL:** local app-rn-runtime path | |**\-\-dest**|**OPTIONAL:** directory where the app has to be copied and built. If it is not specified then .wm-reactnative-cli folder inside the home directory, will contain the build folders | @@ -98,7 +98,7 @@ wm-reactnative build ios [additional_arguments] ~~~ -wm-cordova build ios "/path/to/src" \ +wm-reactnative build ios "/path/to/src" \ --iCertificate="/path/to/distribution.p12" \ --iCertificatePassword="unlock_password" \ --iProvisioningFile="/path/to/profile.mobileprovision" \ From 7b5ab5b61d7d6f8c8b4634a0338b049e1086d292 Mon Sep 17 00:00:00 2001 From: bandhavya Date: Wed, 14 Jul 2021 14:26:09 +0530 Subject: [PATCH 02/49] Refactored code and retriving data from wm_rn_config.json --- src/android.js | 32 ++++++++++------ src/command.js | 92 ++++++++++++++++++++++++++------------------- src/requirements.js | 14 +++---- 3 files changed, 81 insertions(+), 57 deletions(-) diff --git a/src/android.js b/src/android.js index e1c553b..31facde 100644 --- a/src/android.js +++ b/src/android.js @@ -34,7 +34,7 @@ async function generateSignedApk(keyStore, storePassword, keyAlias, keyPassword) const keystoreName = namesArr[namesArr.length - 1]; const filepath = config.src + 'android/app/' + keystoreName; - fs.copyFileSync(ksData.keyStore, filepath); + fs.copyFileSync(keyStore, filepath); // edit file android/gradle.properties const gradlePropsPath = config.src + 'android/gradle.properties'; @@ -92,6 +92,10 @@ async function generateAab() { } catch(e) { console.error('error generating release apk. ', e); + return { + success: false, + errors: e + } } } @@ -105,17 +109,25 @@ function setDebugFlagInGradle(content) { devDisabledInDebug: true,`); } else { newContent = content.replace(/bundleInDebug\: false/gm, `bundleInDebug: true`) - .replace(/devDisabledInDebug\: false/gm, `devDisabledInDebug: true`); + .replace(/devDisabledInDebug\: false/gm, `devDisabledInDebug: true`) + .replace(/bundleInRelease\: true/gm, `bundleInRelease: false`); + } return newContent; } function setReleaseFlagInGradle(content) { - const newContent = content.replace(/^(?!\s)project\.ext\.react = \[/gm, `project.ext.react = [ + let newContent; + if (content.search(`entryFile: "index.js"`) === -1) { + newContent = content.replace(/^(?!\s)project\.ext\.react = \[/gm, `project.ext.react = [ entryFile: "index.js", bundleAssetName: "index.android.bundle", bundleInRelease: true,`); - - return newContent; + } else { + newContent = content.replace(/bundleInDebug\: true/gm, `bundleInDebug: false, + bundleInRelease: true,`).replace(/devDisabledInDebug\: true/gm, ``) + .replace(/bundleInRelease\: false/gm, `bundleInRelease: true`); + } + return newContent; } const endWith = (str, suffix) => { @@ -173,6 +185,9 @@ async function invokeAndroidBuild(args) { } } + const appName = config.metaData.name; + await updateSettingsGradleFile(appName); + if (args.packageType === 'production') { const errors = validateForAndroid(keyStore, storePassword, keyAlias, keyPassword); if (errors.length > 0) { @@ -189,12 +204,7 @@ async function invokeAndroidBuild(args) { label: loggerLabel, message: 'Updated build.gradle file with debug configuration' }); - if (!Object.keys(config.metaData).length) { - config.metaData = await config.setMetaInfo(config.src); - } - const appName = config.metaData.expo.name; - updateSettingsGradleFile(appName); await execa('./gradlew', ['clean'], { cwd: config.src + 'android' }); @@ -206,7 +216,7 @@ async function invokeAndroidBuild(args) { message: 'build completed' }); const output = args.dest + 'output/android/'; - const outputFilePath = `${output}${appName}(${config.metaData.expo.version}).${args.packageType}.apk`; + const outputFilePath = `${output}${appName}(${config.metaData.version}).${args.packageType}.apk`; const apkPath = findFile(`${args.dest}/android/app/build/outputs/apk/${args.packageType === 'production' ? 'release' : 'debug'}`, /\.apk?/); fs.mkdirSync(output, {recursive: true}); fs.copyFileSync(apkPath, outputFilePath); diff --git a/src/command.js b/src/command.js index d63cb19..8e48771 100644 --- a/src/command.js +++ b/src/command.js @@ -44,27 +44,24 @@ function updateExpoplistFile() { async function updatePackageJsonFile(path) { return await new Promise(resolve => { try { - // TODO add main: "index" - // if (fs.existsSync(path)) { - fs.readFile(path, async function(error, data) { - if (error) { - throw error; - } - var jsonData = JSON.parse(data); - jsonData['main'] = "index"; - await fs.writeFile(path, JSON.stringify(jsonData), error => { + fs.readFile(path, async function(error, data) { if (error) { throw error; } - console.log('updated package.json file'); - resolve('success'); - }); - }) - // } -} catch (e) { - resolve('error', e); -} -}) + var jsonData = JSON.parse(data); + jsonData['main'] = "index"; + await fs.writeFile(path, JSON.stringify(jsonData), error => { + if (error) { + throw error; + } + console.log('updated package.json file'); + resolve('success'); + }); + }) + } catch (e) { + resolve('error', e); + } + }) } async function updateAppJsonFile(content, appId, src) { @@ -106,14 +103,15 @@ async function updateAppJsonFile(content, appId, src) { process.exit(); } } - if (args.dest) { + config.metaData = await readWmRNConfig(args.src); + + if (args.dest) { args.dest = path.resolve(args.dest) + '/'; // Do not eject again if its already ejected in dest folder if (!fs.existsSync(args.dest + 'app.json')) { await ejectProject(args); } else { - config.metaData = await config.setMetaInfo(args.dest); - if (!config.metaData.expo.ejected) { + if (!config.metaData.ejected) { await ejectProject(args); } } @@ -206,14 +204,8 @@ async function setupBuildDirectory(src, dest) { fs.copySync(src, dest); } - - -async function getDefaultDestination(appId) { - // let data = fs.readFileSync(projectDir + 'config.xml').toString(); - // const config = et.parse(data); - // const id = config.getroot().attrib['id']; - // const version = config.getroot().attrib['version']; - const id = appId; +async function getDefaultDestination() { + const id = config.metaData.id; const version = '1.0.0'; const path = `${require('os').homedir()}/.wm-reactnative-cli/build/${id}/${version}/`; fs.mkdirSync(path, { @@ -240,6 +232,30 @@ async function getDefaultDestination(appId) { return dest; } +async function readWmRNConfig(src) { + src = path.resolve(src) + '/'; + let jsonPath = src + 'wm_rn_config.json'; + let data = await fs.readFileSync(jsonPath); + return JSON.parse(data); +} + +async function writeWmRNConfig(content) { + src = path.resolve(config.src) + '/'; + let jsonPath = src + 'wm_rn_config.json'; + let data = await fs.readFileSync(jsonPath); + data = JSON.parse(data); + if (content) { + Object.assign(data, content); + } + await fs.writeFile(jsonPath, JSON.stringify(data), error => { + if (error) { + throw error; + } + resolve('success'); + console.log('updated app.json file'); + }) +} + // src points to unzip proj async function ejectProject(args) { try { @@ -271,9 +287,7 @@ async function ejectProject(args) { args.dest = await getDefaultDestination(args.appId); } args.dest = path.resolve(args.dest) + '/'; - // if (!isZipFile) { - // args.dest += folderName + '/'; - // } + if(args.src === args.dest) { logger.error({ label: loggerLabel, @@ -295,9 +309,9 @@ async function ejectProject(args) { return false; } await updateAppJsonFile({ - 'name': folderName, - 'slug': folderName - }, args.appId, args.src); + 'name': config.metaData.name, + 'slug': config.metaData.name + }, config.metaData.id, args.src); await updatePackageJsonFile(config.src + 'package.json'); // yarn install --network-timeout=30000 await exec('yarn', ['install'], { @@ -316,13 +330,13 @@ async function ejectProject(args) { await execa('git', ['init'], { cwd: config.src }); - console.log('before expo eject'); + console.log('invoking expo eject'); await execa('expo', ['eject'], { cwd: config.src }); - await updateAppJsonFile({ejected: true}); - console.log('after expo eject'); -}catch (e) { + await writeWmRNConfig({ejected: true}); + console.log('expo eject succeded'); +} catch (e) { logger.error({ label: loggerLabel, message: args.platform + ' BUILD Failed. Due to :' + e diff --git a/src/requirements.js b/src/requirements.js index 103cf9d..7fb7473 100644 --- a/src/requirements.js +++ b/src/requirements.js @@ -7,7 +7,7 @@ const logger = require('./logger'); const { exec } = require('./exec'); -const loggerLabel = 'cordova-cli-requirements'; +const loggerLabel = 'rn-cli-requirements'; const VERSIONS = { 'NODE': '12.0.0', 'POD' : '1.9.0', @@ -26,10 +26,10 @@ async function checkAvailability(cmd, transformFn) { } } let output = (await exec(cmd, ['--version'])).join(''); - + if (transformFn) { - output = transformFn(output); - } + output = transformFn(output); + } // to just return version in x.x.x format let version = output.match(/[0-9]+\.[0-9\.]+/)[0]; @@ -91,7 +91,7 @@ async function checkForAndroidStudioAvailability() { 'message': 'Found Android SDK manager at ' + sdkPath }); try { - await exec(sdkPath, ['--list']); + await exec(sdkPath, ['--list']); } catch(e) { console.warn(e); } @@ -111,7 +111,7 @@ async function hasValidJavaVersion() { return false; } - const envVariable = process.env['JAVA_HOME']; + const envVariable = process.env['JAVA_HOME']; if (!envVariable) { logger.error({ @@ -189,7 +189,7 @@ async function showConfirmation(message) { if (err) { reject(); } - resolve(result.confirm.toLowerCase()); + resolve(result.confirm.toLowerCase()); }); }); } From 1b3eb7ae4e27a44cf58b29d5e232ed2221d0f989 Mon Sep 17 00:00:00 2001 From: bandhavya Date: Wed, 14 Jul 2021 15:30:35 +0530 Subject: [PATCH 03/49] Updated doc --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 5f10e9e..323ffc1 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,6 @@ wm-reactnative android [additional_arguments] |                   **Argument**                   | **Description** | |--|--| | **src_dir** | **DEFAULT:** current working directory.
Path to the reactnative expo zip (or) path to the reactnative expo project folder. | -|**\-\-appId:** application id.| | **\-\-localrnruntimepath** |**OPTIONAL:** local app-rn-runtime path | |**\-\-dest**|**OPTIONAL:** directory where the app has to be copied and built. If it is not specified then .wm-reactnative-cli folder inside the home directory, will contain the build folders | |**\-\-auto-eject**|**OPTIONAL:** On setting this flag to true, expo eject will be invoke automatically.| @@ -41,7 +40,7 @@ wm-reactnative android [additional_arguments] ### Example 1 ~~~ -wm-reactnative build android "/path/to/src" --appId="app_id" +wm-reactnative build android "/path/to/src" ~~~ ### Example 2 ~~~ @@ -83,7 +82,6 @@ wm-reactnative build ios [additional_arguments] |                   **Argument**                     | **Description** | |--|--| | **src_dir** | **DEFAULT:** current working directory.
Path to the reactnative expo zip (or) path to the reactnative expo project folder. | -|**\-\-appId:** application id.| | **\-\-localrnruntimepath** |**OPTIONAL:** local app-rn-runtime path | |**\-\-dest**|**OPTIONAL:** directory where the app has to be copied and built. If it is not specified then .wm-reactnative-cli folder inside the home directory, will contain the build folders | |**\-\-auto-eject**|**OPTIONAL:** On setting this flag to true, expo eject will be invoke automatically.| From 65f5d42a9d512df3f0525a7b79871b7337f5251a Mon Sep 17 00:00:00 2001 From: bandhavya Date: Thu, 15 Jul 2021 23:23:37 +0530 Subject: [PATCH 04/49] Fixes: replaced execa with exec for build logs output. Also fixed few reference issues --- package.json | 1 + src/android.js | 17 ++++++++--------- src/command.js | 13 ++++++------- src/ios.js | 52 +++++++++++++++++--------------------------------- 4 files changed, 32 insertions(+), 51 deletions(-) diff --git a/package.json b/package.json index 6d115b1..8822719 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "execa": "^4.0.3", "fs-extra": "^9.0.1", "plist": "^3.0.2", + "prompt": "^1.0.0", "semver": "^7.3.2", "winston": "^3.3.3", "yargs": "^15.4.0", diff --git a/src/android.js b/src/android.js index 31facde..5088ab5 100644 --- a/src/android.js +++ b/src/android.js @@ -1,10 +1,9 @@ const fs = require('fs-extra'); -const execa = require('execa'); const logger = require('./logger'); -const plist = require('plist'); -const path = require('path'); const config = require('./config'); -const exec = require('./exec'); +const { + exec +} = require('./exec'); const { validateForAndroid, @@ -79,14 +78,14 @@ function setSigningConfigInGradle() { async function generateAab() { try { - await execa('./gradlew', ['clean'], { + await exec('./gradlew', ['clean'], { cwd: config.src + 'android' }); - await execa('./gradlew', [':app:bundleRelease'], { + await exec('./gradlew', [':app:bundleRelease'], { cwd: config.src + 'android' }); - await execa('react-native', ['run-android', '--variant=release'], { + await exec('react-native', ['run-android', '--variant=release'], { cwd: config.src }); } @@ -205,10 +204,10 @@ async function invokeAndroidBuild(args) { message: 'Updated build.gradle file with debug configuration' }); - await execa('./gradlew', ['clean'], { + await exec('./gradlew', ['clean'], { cwd: config.src + 'android' }); - await execa('./gradlew', ['assembleDebug'], { + await exec('./gradlew', ['assembleDebug'], { cwd: config.src + 'android' }); logger.info({ diff --git a/src/command.js b/src/command.js index 8e48771..ab90501 100644 --- a/src/command.js +++ b/src/command.js @@ -1,11 +1,9 @@ const fs = require('fs-extra'); -const execa = require('execa'); const logger = require('./logger'); const plist = require('plist'); const path = require('path'); const android = require('./android'); const { showConfirmation } = require('./requirements'); - const { exec } = require('./exec'); @@ -144,10 +142,10 @@ async function updateAppJsonFile(content, appId, src) { } else if (config.buildType === 'ios') { updateExpoplistFile(); - await execa('pod', ['install'], { + await exec('pod', ['install'], { cwd: config.src + 'ios' }); - await execa('react-native', ['run-ios'], { + await exec('react-native', ['run-ios'], { cwd: config.src }); result = await invokeiosBuild(args); @@ -327,15 +325,16 @@ async function ejectProject(args) { await fs.copySync(args.localrnruntimepath, linkFolderPath); console.log('copied the app-rn-runtime folder'); } - await execa('git', ['init'], { + await exec('git', ['init'], { cwd: config.src }); console.log('invoking expo eject'); - await execa('expo', ['eject'], { + await exec('expo', ['eject'], { cwd: config.src }); - await writeWmRNConfig({ejected: true}); console.log('expo eject succeded'); + await writeWmRNConfig({ejected: true}); + console.log('write failed'); } catch (e) { logger.error({ label: loggerLabel, diff --git a/src/ios.js b/src/ios.js index fae4d5a..6d7a0d2 100644 --- a/src/ios.js +++ b/src/ios.js @@ -1,9 +1,7 @@ -const execa = require('execa'); const fs = require('fs-extra'); const logger = require('./logger'); const config = require('./config'); const path = require('path'); -const plist = require('plist'); const { exec @@ -24,9 +22,9 @@ async function importCertToKeyChain(keychainName, certificate, certificatePasswo let keychains = await exec('security', ['list-keychains', '-d', 'user'], {log: false}); keychains = keychains.map(k => k.replace(/[\"\s]+/g, '')).filter(k => k !== ''); await exec('security', ['list-keychains', '-d', 'user', '-s', keychainName, ...keychains], {log: false}); - await exec('security', - ['import', - certificate, + await exec('security', + ['import', + certificate, '-k', keychainName, '-P', certificatePassword, '-T', '/usr/bin/codesign', @@ -84,31 +82,14 @@ async function getPackageType(provisionalFile) { } if (data.type === 'inhouse') { return 'enterprise'; - } + } if (data.type === 'adhoc') { return 'ad-hoc'; } throw new Error('Not able find the type of provisioning file.'); } -function setMetaInfo() { - config.src = path.resolve(config.src) + '/'; - const jsonPath = config.src + 'app.json'; - let data = fs.readFileSync(jsonPath); - console.log(data); - config.metaData = JSON.parse(data); -} - -function getAppName() { - return config.metaData['expo']['name']; -} -function getAppId() { - return config.metaData['expo']['ios']['bundleIdentifier']; -} - async function invokeiosBuild(args) { - setMetaInfo(); - const certificate = args.iCertificate; const certificatePassword = args.iCertificatePassword; const provisionalFile = args.iProvisioningFile; @@ -146,13 +127,14 @@ async function invokeiosBuild(args) { }) const targetProvisionsalPath = `${ppFolder}/${provisionuuid}.mobileprovision`; const removeKeyChain = await importCertToKeyChain(keychainName, certificate, certificatePassword); - // fs.copyFileSync(provisionalFile, targetProvisionsalPath); - // logger.info({ - // label: loggerLabel, - // message: `copied provisionalFile (${provisionalFile}).` - // }); + try { await xcodebuild(args.iCodeSigningIdentity, provisionuuid, developmentTeamId); + } catch (e) { + return { + errors: e, + success: false + } } finally { await removeKeyChain(); } @@ -162,7 +144,7 @@ async function invokeiosBuild(args) { async function updateInfoPlist(appName, PROVISIONING_UUID) { return await new Promise(resolve => { try { - const appId = getAppId(); + const appId = config.metaData.id; const infoPlistpath = config.src + 'ios/build/' + appName +'.xcarchive/Info.plist'; fs.readFile(infoPlistpath, async function (err, data) { @@ -186,24 +168,24 @@ async function updateInfoPlist(appName, PROVISIONING_UUID) { } async function xcodebuild(CODE_SIGN_IDENTITY_VAL, PROVISIONING_UUID, DEVELOPMENT_TEAM) { - const appName = getAppName(); - await execa('xcodebuild', ['-workspace', appName + '.xcworkspace', '-scheme', appName, '-configuration', 'Release', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'DEVELOPMENT_TEAM=' + DEVELOPMENT_TEAM, 'CODE_SIGN_STYLE=Manual'], { + const appName = config.metaData.name; + await exec('xcodebuild', ['-workspace', appName + '.xcworkspace', '-scheme', appName, '-configuration', 'Release', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'DEVELOPMENT_TEAM=' + DEVELOPMENT_TEAM, 'CODE_SIGN_STYLE=Manual'], { cwd: config.src + 'ios' }); - await execa('xcodebuild', ['-workspace', appName + '.xcworkspace', '-scheme', appName, '-configuration', 'Release', '-archivePath', 'build/' + appName + '.xcarchive', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'archive', 'CODE_SIGN_STYLE=Manual'], { + await exec('xcodebuild', ['-workspace', appName + '.xcworkspace', '-scheme', appName, '-configuration', 'Release', '-archivePath', 'build/' + appName + '.xcarchive', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'archive', 'CODE_SIGN_STYLE=Manual'], { cwd: config.src + 'ios' }); const status = await updateInfoPlist(appName, PROVISIONING_UUID); if (status === 'success') { - await execa('xcodebuild', ['-exportArchive', '-archivePath', 'build/' + appName + '.xcarchive', '-exportOptionsPlist', 'build/' + appName + '.xcarchive/Info.plist', '-exportPath', 'build'], { + await exec('xcodebuild', ['-exportArchive', '-archivePath', 'build/' + appName + '.xcarchive', '-exportOptionsPlist', 'build/' + appName + '.xcarchive/Info.plist', '-exportPath', 'build'], { cwd: config.src + 'ios' }); } - + } module.exports = { invokeiosBuild: invokeiosBuild -} \ No newline at end of file +} From 2eb47542a98d0a17bb5ffe0eac232b50fedba4be Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Sat, 17 Jul 2021 08:50:56 +0530 Subject: [PATCH 05/49] changed package type to build type --- index.js | 10 ++++++++-- src/android.js | 12 ++++++------ src/ios.js | 6 +++--- src/requirements.js | 4 ++-- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index c4ef585..0d5a97d 100755 --- a/index.js +++ b/index.js @@ -33,6 +33,12 @@ const args = require('yargs') describe: '(Android) password for key.', type: 'string' }) + .option('p', { + alias: 'packageType', + describe: 'apk (or) bundle', + default: 'apk', + choices: ['apk', 'bundle'] + }) }, args => { args.platform = 'android'; build(args) @@ -73,8 +79,8 @@ const args = require('yargs') describe: 'dest folder where the react native project will be extracted to', type: 'string' }) - .option('p', { - alias: 'packageType', + .option('bt', { + alias: 'buildType', describe: 'development (or) release', default: 'development', choices: ['development', 'production'] diff --git a/src/android.js b/src/android.js index 5088ab5..0befcea 100644 --- a/src/android.js +++ b/src/android.js @@ -164,7 +164,7 @@ async function updateSettingsGradleFile(appName) { async function invokeAndroidBuild(args) { let keyStore, storePassword, keyAlias,keyPassword; - if (args.packageType === 'development' && !args.aKeyStore) { + if (args.buildType === 'development' && !args.aKeyStore) { keyStore = __dirname + '/../defaults/android-debug.keystore'; keyAlias = 'androiddebugkey'; keyPassword = 'android'; @@ -187,7 +187,7 @@ async function invokeAndroidBuild(args) { const appName = config.metaData.name; await updateSettingsGradleFile(appName); - if (args.packageType === 'production') { + if (args.buildType === 'production') { const errors = validateForAndroid(keyStore, storePassword, keyAlias, keyPassword); if (errors.length > 0) { return { @@ -195,10 +195,10 @@ async function invokeAndroidBuild(args) { errors: errors } } - await updateAndroidBuildGradleFile(args.packageType); + await updateAndroidBuildGradleFile(args.buildType); await generateSignedApk(keyStore, storePassword, keyAlias, keyPassword); } else { - await updateAndroidBuildGradleFile(args.packageType); + await updateAndroidBuildGradleFile(args.buildType); logger.info({ label: loggerLabel, message: 'Updated build.gradle file with debug configuration' @@ -215,8 +215,8 @@ async function invokeAndroidBuild(args) { message: 'build completed' }); const output = args.dest + 'output/android/'; - const outputFilePath = `${output}${appName}(${config.metaData.version}).${args.packageType}.apk`; - const apkPath = findFile(`${args.dest}/android/app/build/outputs/apk/${args.packageType === 'production' ? 'release' : 'debug'}`, /\.apk?/); + const outputFilePath = `${output}${appName}(${config.metaData.version}).${args.buildType}.apk`; + const apkPath = findFile(`${args.dest}/android/app/build/outputs/apk/${args.buildType === 'production' ? 'release' : 'debug'}`, /\.apk?/); fs.mkdirSync(output, {recursive: true}); fs.copyFileSync(apkPath, outputFilePath); return { diff --git a/src/ios.js b/src/ios.js index 6d7a0d2..02874ca 100644 --- a/src/ios.js +++ b/src/ios.js @@ -93,13 +93,13 @@ async function invokeiosBuild(args) { const certificate = args.iCertificate; const certificatePassword = args.iCertificatePassword; const provisionalFile = args.iProvisioningFile; - const packageType = args.packageType; + const buildType = args.buildType; if (!await hasValidNodeVersion() || !await isGitInstalled() || !await isCocoaPodsIstalled()) { return { success: false } } - const errors = validateForIos(certificate, certificatePassword, provisionalFile, packageType); + const errors = validateForIos(certificate, certificatePassword, provisionalFile, buildType); if (errors.length > 0) { return { success: false, @@ -115,7 +115,7 @@ async function invokeiosBuild(args) { label: loggerLabel, message: `provisional UUID : ${provisionuuid}` }); - const codeSignIdentity = packageType === 'production' ? "iPhone Distribution" : "iPhone Developer"; + const codeSignIdentity = buildType === 'production' ? "iPhone Distribution" : "iPhone Developer"; const developmentTeamId = await extractTeamId(provisionalFile); logger.info({ label: loggerLabel, diff --git a/src/requirements.js b/src/requirements.js index 7fb7473..d049752 100644 --- a/src/requirements.js +++ b/src/requirements.js @@ -156,7 +156,7 @@ function validateForAndroid(keyStore, storePassword, keyAlias, keyPassword) { return errors; } -function validateForIos(certificate, password, provisionalFilePath, packageType) { +function validateForIos(certificate, password, provisionalFilePath, buildType) { let errors = []; if (!(certificate && fs.existsSync(certificate))) { errors.push(`p12 certificate does not exists : ${certificate}`); @@ -167,7 +167,7 @@ function validateForIos(certificate, password, provisionalFilePath, packageType) if (!(provisionalFilePath && fs.existsSync(provisionalFilePath))) { errors.push(`Provisional file does not exists : ${provisionalFilePath}`); } - if (!packageType) { + if (!buildType) { errors.push('Package type is required.'); } return errors; From cb01103d4128249143b46c67a4d5ba2b68bb2013 Mon Sep 17 00:00:00 2001 From: bandhavya Date: Mon, 19 Jul 2021 10:57:43 +0530 Subject: [PATCH 06/49] Fixes: update for supporting buildType packageType for build --- index.js | 15 ++++++++--- src/android.js | 69 ++++++++++++++++++++++++++++++-------------------- src/command.js | 38 +++++++++++++-------------- src/ios.js | 47 ++++++++++++++-------------------- 4 files changed, 90 insertions(+), 79 deletions(-) diff --git a/index.js b/index.js index 0d5a97d..2af210c 100755 --- a/index.js +++ b/index.js @@ -81,9 +81,18 @@ const args = require('yargs') }) .option('bt', { alias: 'buildType', - describe: 'development (or) release', - default: 'development', - choices: ['development', 'production'] + describe: 'development (or) debug (or) production (or) release', + default: 'debug', + coerce: (val) => { + if (val === 'development') { + return 'debug'; + } + if (val === 'production') { + return 'release'; + } + return val; + }, + choices: ['development', 'debug', 'production', 'release'] }) .option('localrnruntimepath', { alias: 'localrnruntimepath', diff --git a/src/android.js b/src/android.js index 0befcea..ba60f6a 100644 --- a/src/android.js +++ b/src/android.js @@ -27,7 +27,7 @@ function setKeyStoreValuesInGradleProps(content, keystoreName, ksData) { return content; } // Reference: http://reactnative.dev/docs/signed-apk-android -async function generateSignedApk(keyStore, storePassword, keyAlias, keyPassword) { +async function generateSignedApk(keyStore, storePassword, keyAlias, keyPassword, packageType) { const ksData = {storePassword: storePassword, keyAlias: keyAlias, keyPassword: keyPassword}; const namesArr = keyStore.split('/'); const keystoreName = namesArr[namesArr.length - 1]; @@ -47,7 +47,7 @@ async function generateSignedApk(keyStore, storePassword, keyAlias, keyPassword) let content = fs.readFileSync(appGradlePath, 'utf8'); content = await updateSigningConfig(content); fs.writeFileSync(appGradlePath, content); - await generateAab(); + await generateAab(packageType); } function updateSigningConfig(content) { @@ -76,18 +76,20 @@ function setSigningConfigInGradle() { generateAab(); } -async function generateAab() { +async function generateAab(packageType) { try { await exec('./gradlew', ['clean'], { cwd: config.src + 'android' }); - await exec('./gradlew', [':app:bundleRelease'], { - cwd: config.src + 'android' - }); - - await exec('react-native', ['run-android', '--variant=release'], { - cwd: config.src - }); + if (packageType === 'bundle') { + await exec('./gradlew', [':app:bundleRelease'], { + cwd: config.src + 'android' + }); + } else { + await exec('./gradlew', ['assembleRelease'], { + cwd: config.src + 'android' + }); + } } catch(e) { console.error('error generating release apk. ', e); @@ -148,7 +150,7 @@ async function updateAndroidBuildGradleFile(type) { console.log(data); let content = fs.readFileSync(path, 'utf8'); - content = type === 'production' ? await setReleaseFlagInGradle(content) : await setDebugFlagInGradle(content); + content = type === 'release' ? await setReleaseFlagInGradle(content) : await setDebugFlagInGradle(content); await fs.writeFileSync(path, content); } @@ -164,7 +166,7 @@ async function updateSettingsGradleFile(appName) { async function invokeAndroidBuild(args) { let keyStore, storePassword, keyAlias,keyPassword; - if (args.buildType === 'development' && !args.aKeyStore) { + if (args.buildType === 'debug' && !args.aKeyStore) { keyStore = __dirname + '/../defaults/android-debug.keystore'; keyAlias = 'androiddebugkey'; keyPassword = 'android'; @@ -187,7 +189,7 @@ async function invokeAndroidBuild(args) { const appName = config.metaData.name; await updateSettingsGradleFile(appName); - if (args.buildType === 'production') { + if (args.buildType === 'release') { const errors = validateForAndroid(keyStore, storePassword, keyAlias, keyPassword); if (errors.length > 0) { return { @@ -196,34 +198,47 @@ async function invokeAndroidBuild(args) { } } await updateAndroidBuildGradleFile(args.buildType); - await generateSignedApk(keyStore, storePassword, keyAlias, keyPassword); + await generateSignedApk(keyStore, storePassword, keyAlias, keyPassword, args.packageType); } else { await updateAndroidBuildGradleFile(args.buildType); logger.info({ label: loggerLabel, message: 'Updated build.gradle file with debug configuration' }); - + try { await exec('./gradlew', ['clean'], { cwd: config.src + 'android' }); await exec('./gradlew', ['assembleDebug'], { cwd: config.src + 'android' }); - logger.info({ - label: loggerLabel, - message: 'build completed' - }); - const output = args.dest + 'output/android/'; - const outputFilePath = `${output}${appName}(${config.metaData.version}).${args.buildType}.apk`; - const apkPath = findFile(`${args.dest}/android/app/build/outputs/apk/${args.buildType === 'production' ? 'release' : 'debug'}`, /\.apk?/); - fs.mkdirSync(output, {recursive: true}); - fs.copyFileSync(apkPath, outputFilePath); + } catch(e) { + console.error('error generating release apk. ', e); return { - success: true, - output: outputFilePath - }; + success: false, + errors: e + } + } + } + logger.info({ + label: loggerLabel, + message: 'build completed' + }); + const output = args.dest + 'output/android/'; + const outputFilePath = `${output}${appName}(${config.metaData.version}).${args.buildType}.${args.packageType === 'bundle' ? 'aab': 'apk'}`; + + let bundlePath = null; + if (args.packageType === 'bundle') { + bundlePath = findFile(`${args.dest}/android/app/build/outputs/bundle/${buildType}`, /\.aab?/); + } else { + bundlePath = findFile(`${args.dest}/android/app/build/outputs/apk/${args.buildType}`, /\.apk?/); } + fs.mkdirSync(output, {recursive: true}); + fs.copyFileSync(bundlePath, outputFilePath); + return { + success: true, + output: outputFilePath + }; } module.exports = { diff --git a/src/command.js b/src/command.js index ab90501..bc4d37d 100644 --- a/src/command.js +++ b/src/command.js @@ -4,6 +4,8 @@ const plist = require('plist'); const path = require('path'); const android = require('./android'); const { showConfirmation } = require('./requirements'); +const execa = require('execa'); + const { exec } = require('./exec'); @@ -102,22 +104,16 @@ async function updateAppJsonFile(content, appId, src) { } } config.metaData = await readWmRNConfig(args.src); - + config.platform = args.platform; if (args.dest) { args.dest = path.resolve(args.dest) + '/'; - // Do not eject again if its already ejected in dest folder - if (!fs.existsSync(args.dest + 'app.json')) { + if (!config.metaData.ejected) { await ejectProject(args); - } else { - if (!config.metaData.ejected) { - await ejectProject(args); - } } } else { await ejectProject(args); } - config.buildType = args.platform; if (args.dest) { config.src = args.dest; } @@ -137,17 +133,14 @@ async function updateAppJsonFile(content, appId, src) { try { let result; - if (config.buildType === 'android') { + if (config.platform === 'android') { result = await android.invokeAndroidBuild(args); - } else if (config.buildType === 'ios') { + } else if (config.platform === 'ios') { updateExpoplistFile(); - await exec('pod', ['install'], { + await execa('pod', ['install'], { cwd: config.src + 'ios' }); - await exec('react-native', ['run-ios'], { - cwd: config.src - }); result = await invokeiosBuild(args); } if (result.errors && result.errors.length) { @@ -178,6 +171,10 @@ async function updateAppJsonFile(content, appId, src) { message: 'BUILD Failed. Due to :' + e }); console.error(e); + return { + success : false, + errors: e + }; } } @@ -249,8 +246,7 @@ async function writeWmRNConfig(content) { if (error) { throw error; } - resolve('success'); - console.log('updated app.json file'); + console.log('updated wm_rn_config.json file'); }) } @@ -298,9 +294,10 @@ async function ejectProject(args) { label: loggerLabel, message: 'destination folder where app is build at ' + args.dest }) - if (!args.buildType) { - args.buildType = 'android'; + if (!args.platform) { + args.platform = 'android'; } + config.platform = args.platform; config.buildType = args.buildType; if (!await hasValidNodeVersion(config.src)) { @@ -309,7 +306,7 @@ async function ejectProject(args) { await updateAppJsonFile({ 'name': config.metaData.name, 'slug': config.metaData.name - }, config.metaData.id, args.src); + }, config.metaData.id, config.src); await updatePackageJsonFile(config.src + 'package.json'); // yarn install --network-timeout=30000 await exec('yarn', ['install'], { @@ -329,12 +326,11 @@ async function ejectProject(args) { cwd: config.src }); console.log('invoking expo eject'); - await exec('expo', ['eject'], { + await execa('expo', ['eject'], { cwd: config.src }); console.log('expo eject succeded'); await writeWmRNConfig({ejected: true}); - console.log('write failed'); } catch (e) { logger.error({ label: loggerLabel, diff --git a/src/ios.js b/src/ios.js index 02874ca..06cdfa4 100644 --- a/src/ios.js +++ b/src/ios.js @@ -74,21 +74,6 @@ async function getUsername() { return content[0]; } -async function getPackageType(provisionalFile) { - const data = await pparse(provisionalFile); - //data. - if (data.type === 'appstore') { - return 'app-store'; - } - if (data.type === 'inhouse') { - return 'enterprise'; - } - if (data.type === 'adhoc') { - return 'ad-hoc'; - } - throw new Error('Not able find the type of provisioning file.'); -} - async function invokeiosBuild(args) { const certificate = args.iCertificate; const certificatePassword = args.iCertificatePassword; @@ -115,7 +100,7 @@ async function invokeiosBuild(args) { label: loggerLabel, message: `provisional UUID : ${provisionuuid}` }); - const codeSignIdentity = buildType === 'production' ? "iPhone Distribution" : "iPhone Developer"; + const codeSignIdentity = buildType === 'release' ? "iPhone Distribution" : "iPhone Developer"; const developmentTeamId = await extractTeamId(provisionalFile); logger.info({ label: loggerLabel, @@ -129,7 +114,7 @@ async function invokeiosBuild(args) { const removeKeyChain = await importCertToKeyChain(keychainName, certificate, certificatePassword); try { - await xcodebuild(args.iCodeSigningIdentity, provisionuuid, developmentTeamId); + await xcodebuild(codeSignIdentity, provisionuuid, developmentTeamId); } catch (e) { return { errors: e, @@ -169,21 +154,27 @@ async function updateInfoPlist(appName, PROVISIONING_UUID) { async function xcodebuild(CODE_SIGN_IDENTITY_VAL, PROVISIONING_UUID, DEVELOPMENT_TEAM) { const appName = config.metaData.name; - await exec('xcodebuild', ['-workspace', appName + '.xcworkspace', '-scheme', appName, '-configuration', 'Release', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'DEVELOPMENT_TEAM=' + DEVELOPMENT_TEAM, 'CODE_SIGN_STYLE=Manual'], { - cwd: config.src + 'ios' - }); - - await exec('xcodebuild', ['-workspace', appName + '.xcworkspace', '-scheme', appName, '-configuration', 'Release', '-archivePath', 'build/' + appName + '.xcarchive', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'archive', 'CODE_SIGN_STYLE=Manual'], { - cwd: config.src + 'ios' - }); + try { + await exec('xcodebuild', ['-workspace', appName + '.xcworkspace', '-scheme', appName, '-configuration', 'Release', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'DEVELOPMENT_TEAM=' + DEVELOPMENT_TEAM, 'CODE_SIGN_STYLE=Manual'], { + cwd: config.src + 'ios' + }); - const status = await updateInfoPlist(appName, PROVISIONING_UUID); - if (status === 'success') { - await exec('xcodebuild', ['-exportArchive', '-archivePath', 'build/' + appName + '.xcarchive', '-exportOptionsPlist', 'build/' + appName + '.xcarchive/Info.plist', '-exportPath', 'build'], { + await exec('xcodebuild', ['-workspace', appName + '.xcworkspace', '-scheme', appName, '-configuration', 'Release', '-archivePath', 'build/' + appName + '.xcarchive', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'archive', 'CODE_SIGN_STYLE=Manual'], { cwd: config.src + 'ios' }); - } + const status = await updateInfoPlist(appName, PROVISIONING_UUID); + if (status === 'success') { + await exec('xcodebuild', ['-exportArchive', '-archivePath', 'build/' + appName + '.xcarchive', '-exportOptionsPlist', 'build/' + appName + '.xcarchive/Info.plist', '-exportPath', 'build'], { + cwd: config.src + 'ios' + }); + } + } catch (e) { + return { + errors: e, + success: false + } + } } module.exports = { From 151b687a02acfa992ed32ee69a1ef12da19d6d88 Mon Sep 17 00:00:00 2001 From: bandhavya Date: Tue, 20 Jul 2021 16:02:07 +0530 Subject: [PATCH 07/49] Fixes: apk path is invalid. check for requirements before yarn install. Updating documentation --- README.md | 11 ++++++++--- src/android.js | 8 ++------ src/command.js | 15 +++++++++++---- src/requirements.js | 1 + 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 323ffc1..4f9d615 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,11 @@ A command line utility to build react native apps created using WaveMaker produc The main goal of wm-reactnative-cli is to simplify generation of APK or IPA for WaveMaker developers. ```wm-reactnative-cli``` combines multiple react-native commands into a single command. First, one has to make sure all the required hardware and software are available and installed. Then execute the command with the appropriate values for arguments. +### Command to Install + +~~~ +npm install -g https://github.com/wavemaker/wm-reactnative-cli +~~~ ## Android Build @@ -21,7 +26,7 @@ The main goal of wm-reactnative-cli is to simplify generation of APK or IPA for ### Command -wm-reactnative android [additional_arguments] +wm-reactnative build android [additional_arguments] |                   **Argument**                   | **Description** | @@ -34,7 +39,7 @@ wm-reactnative android [additional_arguments] |**\-\-aStorePassword**|Password to key store| |**\-\-aKeyAlias**|Alias name of the key| |**\-\-aKeyPassword**|Key Password| -|**\-\-packageType**|**DEFAULT:** development
development or production
Use ‘production’ with keystore specified.| +|**\-\-buildType**|**DEFAULT:** development
development or production
Use ‘production’ with keystore specified.| ### Example 1 @@ -50,7 +55,7 @@ wm-reactnative build android "/path/to/src" \ --aStorePassword="store_password" \ --aKeyAlias="key_alias_name" \ --aKeyPassword="key" \ ---packageType="production" +--buildType="production" --auto-eject=true ~~~ diff --git a/src/android.js b/src/android.js index ba60f6a..e63f603 100644 --- a/src/android.js +++ b/src/android.js @@ -7,10 +7,6 @@ const { const { validateForAndroid, - hasValidNodeVersion, - hasValidJavaVersion, - checkForGradleAvailability, - isGitInstalled, checkForAndroidStudioAvailability } = require('./requirements'); @@ -229,9 +225,9 @@ async function invokeAndroidBuild(args) { let bundlePath = null; if (args.packageType === 'bundle') { - bundlePath = findFile(`${args.dest}/android/app/build/outputs/bundle/${buildType}`, /\.aab?/); + bundlePath = findFile(`${args.dest}android/app/build/outputs/bundle/${buildType}`, /\.aab?/); } else { - bundlePath = findFile(`${args.dest}/android/app/build/outputs/apk/${args.buildType}`, /\.apk?/); + bundlePath = findFile(`${args.dest}android/app/build/outputs/apk/${args.buildType}`, /\.apk?/); } fs.mkdirSync(output, {recursive: true}); fs.copyFileSync(bundlePath, outputFilePath); diff --git a/src/command.js b/src/command.js index bc4d37d..e66d8cc 100644 --- a/src/command.js +++ b/src/command.js @@ -11,7 +11,11 @@ const { } = require('./exec'); const { - hasValidNodeVersion + hasValidNodeVersion, + hasValidJavaVersion, + checkForGradleAvailability, + isGitInstalled, + hasYarnPackage, } = require('./requirements'); const config = require('./config'); @@ -300,15 +304,17 @@ async function ejectProject(args) { config.platform = args.platform; config.buildType = args.buildType; - if (!await hasValidNodeVersion(config.src)) { - return false; + if (!await hasValidNodeVersion() || !await hasValidJavaVersion() || !await hasYarnPackage() || + !await checkForGradleAvailability() || !await isGitInstalled()) { + return { + success: false + } } await updateAppJsonFile({ 'name': config.metaData.name, 'slug': config.metaData.name }, config.metaData.id, config.src); await updatePackageJsonFile(config.src + 'package.json'); - // yarn install --network-timeout=30000 await exec('yarn', ['install'], { cwd: config.src }); @@ -322,6 +328,7 @@ async function ejectProject(args) { await fs.copySync(args.localrnruntimepath, linkFolderPath); console.log('copied the app-rn-runtime folder'); } + // expo eject checks whether src is a git repo or not await exec('git', ['init'], { cwd: config.src }); diff --git a/src/requirements.js b/src/requirements.js index d049752..7c51541 100644 --- a/src/requirements.js +++ b/src/requirements.js @@ -207,3 +207,4 @@ module.exports = { checkForGradleAvailability: checkForGradleAvailability } // TODO check for expo-cli, react-native +// TODO: support for multiple react native versions. From cae0ff33946f219f315ba72f39003bb87432dc45 Mon Sep 17 00:00:00 2001 From: bandhavya Date: Tue, 20 Jul 2021 16:47:36 +0530 Subject: [PATCH 08/49] Removed the unneccessary code --- src/android.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/android.js b/src/android.js index e63f603..c7e0fc8 100644 --- a/src/android.js +++ b/src/android.js @@ -174,9 +174,7 @@ async function invokeAndroidBuild(args) { keyPassword = args.aKeyPassword } - if (!await hasValidNodeVersion() || !await hasValidJavaVersion() || - !await checkForGradleAvailability() || !await isGitInstalled() || - !await checkForAndroidStudioAvailability()) { + if (!await checkForAndroidStudioAvailability()) { return { success: false } From 308a46213b01535094c6a4b3e33ef1e8515e3fd5 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Tue, 20 Jul 2021 20:15:55 +0530 Subject: [PATCH 09/49] fixed build type error --- src/android.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/android.js b/src/android.js index c7e0fc8..2cbc1e8 100644 --- a/src/android.js +++ b/src/android.js @@ -222,10 +222,11 @@ async function invokeAndroidBuild(args) { const outputFilePath = `${output}${appName}(${config.metaData.version}).${args.buildType}.${args.packageType === 'bundle' ? 'aab': 'apk'}`; let bundlePath = null; + let _buildType = buildType === 'production' ? 'release' : 'debug'; if (args.packageType === 'bundle') { - bundlePath = findFile(`${args.dest}android/app/build/outputs/bundle/${buildType}`, /\.aab?/); + bundlePath = findFile(`${args.dest}/android/app/build/outputs/bundle/${_buildType}`, /\.aab?/); } else { - bundlePath = findFile(`${args.dest}android/app/build/outputs/apk/${args.buildType}`, /\.apk?/); + bundlePath = findFile(`${args.dest}/android/app/build/outputs/apk/${_buildType}`, /\.apk?/); } fs.mkdirSync(output, {recursive: true}); fs.copyFileSync(bundlePath, outputFilePath); From ecbce9d7c127dfd0d3799c534c57dc1e895da42b Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Tue, 20 Jul 2021 20:36:09 +0530 Subject: [PATCH 10/49] fixed build type error --- src/android.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/android.js b/src/android.js index 2cbc1e8..9a07da3 100644 --- a/src/android.js +++ b/src/android.js @@ -222,11 +222,11 @@ async function invokeAndroidBuild(args) { const outputFilePath = `${output}${appName}(${config.metaData.version}).${args.buildType}.${args.packageType === 'bundle' ? 'aab': 'apk'}`; let bundlePath = null; - let _buildType = buildType === 'production' ? 'release' : 'debug'; + let folder = args.buildType === 'production' ? 'release' : 'debug'; if (args.packageType === 'bundle') { - bundlePath = findFile(`${args.dest}/android/app/build/outputs/bundle/${_buildType}`, /\.aab?/); + bundlePath = findFile(`${args.dest}/android/app/build/outputs/bundle/${folder}`, /\.aab?/); } else { - bundlePath = findFile(`${args.dest}/android/app/build/outputs/apk/${_buildType}`, /\.apk?/); + bundlePath = findFile(`${args.dest}/android/app/build/outputs/apk/${folder}`, /\.apk?/); } fs.mkdirSync(output, {recursive: true}); fs.copyFileSync(bundlePath, outputFilePath); From a7ad82c6aafe3d65833a0c5261ea546cb978640d Mon Sep 17 00:00:00 2001 From: bandhavya Date: Wed, 21 Jul 2021 15:12:29 +0530 Subject: [PATCH 11/49] Support for ios build --- index.js | 5 ---- src/command.js | 53 +++++++++++++++++++++++++++--------------- src/ios.js | 62 ++++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 85 insertions(+), 35 deletions(-) diff --git a/index.js b/index.js index 2af210c..ab30bd3 100755 --- a/index.js +++ b/index.js @@ -58,11 +58,6 @@ const args = require('yargs') alias: 'iProvisioningFile', describe: '(iOS) path of the provisional profile to use', type: 'string' - }) - .option('icsi', { - alias: 'iCodeSigningIdentity', - describe: 'Common Name of the Developer iOS certificate stored in the Keychain Access application', - type: 'string' }); }, args => { args.platform = 'ios'; diff --git a/src/command.js b/src/command.js index e66d8cc..a95efd2 100644 --- a/src/command.js +++ b/src/command.js @@ -34,14 +34,10 @@ function updateExpoplistFile() { return v.endsWith('.xcodeproj') || v.endsWith('.xcworkspace'); }); filename = filename[0].replace('.xcworkspace', '').replace('.xcodeproj', ''); - console.log(filename); -// TODO add check if this already exists const plistPath = iosPath + '/' + filename + '/Supporting/Expo.plist'; var obj = plist.parse(fs.readFileSync(plistPath, 'utf8')); - console.log(JSON.stringify(obj)); - obj['EXUpdatesURL'] = 'https://wavemaker.com'; - console.log(JSON.stringify(obj)); + obj['EXUpdatesURL'] = 'https://wavemaker.com'; // update with some dummy url fs.writeFileSync(plistPath, plist.build(obj)) } @@ -58,7 +54,10 @@ async function updatePackageJsonFile(path) { if (error) { throw error; } - console.log('updated package.json file'); + logger.info({ + 'label': loggerLabel, + 'message': 'updated package.json file' + }); resolve('success'); }); }) @@ -90,7 +89,10 @@ async function updateAppJsonFile(content, appId, src) { throw error; } resolve('success'); - console.log('updated app.json file'); + logger.info({ + 'label': loggerLabel, + 'message': 'updated app.json file' + }); }) }); } @@ -109,13 +111,18 @@ async function updateAppJsonFile(content, appId, src) { } config.metaData = await readWmRNConfig(args.src); config.platform = args.platform; + let response; if (args.dest) { args.dest = path.resolve(args.dest) + '/'; if (!config.metaData.ejected) { - await ejectProject(args); + response = await ejectProject(args); } } else { - await ejectProject(args); + response = await ejectProject(args); + } + + if (response && response.errors) { + return response; } if (args.dest) { @@ -169,12 +176,10 @@ async function updateAppJsonFile(content, appId, src) { } return result; } catch(e) { - console.log('error...'); logger.error({ label: loggerLabel, message: 'BUILD Failed. Due to :' + e }); - console.error(e); return { success : false, errors: e @@ -250,7 +255,10 @@ async function writeWmRNConfig(content) { if (error) { throw error; } - console.log('updated wm_rn_config.json file'); + logger.info({ + 'label': loggerLabel, + 'message': 'updated wm_rn_config.json file' + }) }) } @@ -307,6 +315,7 @@ async function ejectProject(args) { if (!await hasValidNodeVersion() || !await hasValidJavaVersion() || !await hasYarnPackage() || !await checkForGradleAvailability() || !await isGitInstalled()) { return { + errors: 'check if all prerequisites are installed.', success: false } } @@ -326,25 +335,33 @@ async function ejectProject(args) { } await fs.mkdirsSync(linkFolderPath); await fs.copySync(args.localrnruntimepath, linkFolderPath); - console.log('copied the app-rn-runtime folder'); + logger.info({ + 'label': loggerLabel, + 'message': 'copied the app-rn-runtime folder' + }) } // expo eject checks whether src is a git repo or not await exec('git', ['init'], { cwd: config.src }); - console.log('invoking expo eject'); + logger.info({ + 'label': loggerLabel, + 'message': 'invoking expo eject' + }); await execa('expo', ['eject'], { cwd: config.src }); - console.log('expo eject succeded'); + logger.info({ + 'label': loggerLabel, + 'message': 'expo eject succeeded' + }); await writeWmRNConfig({ejected: true}); } catch (e) { logger.error({ label: loggerLabel, - message: args.platform + ' BUILD Failed. Due to :' + e + message: args.platform + ' eject project Failed. Due to :' + e }); - console.error(e); - return { success : false }; + return { errors: e, success : false }; } } diff --git a/src/ios.js b/src/ios.js index 06cdfa4..a0c10b1 100644 --- a/src/ios.js +++ b/src/ios.js @@ -1,7 +1,6 @@ const fs = require('fs-extra'); const logger = require('./logger'); const config = require('./config'); -const path = require('path'); const { exec @@ -36,6 +35,8 @@ async function importCertToKeyChain(keychainName, certificate, certificatePasswo label: loggerLabel, message: `Cerificate at (${certificate}) imported in (${keychainName})` }); + let signingDetails = await exec('security', ['find-identity', '-v', '-p', 'codesigning'], {log: false}); + console.log(signingDetails); return async () => { keychains = keychains.map(k => k.replace(/[\"\s]+/g, '')); await exec('security', ['list-keychains', '-d', 'user', '-s', ...keychains], {log: false}); @@ -79,7 +80,7 @@ async function invokeiosBuild(args) { const certificatePassword = args.iCertificatePassword; const provisionalFile = args.iProvisioningFile; const buildType = args.buildType; - if (!await hasValidNodeVersion() || !await isGitInstalled() || !await isCocoaPodsIstalled()) { + if (!await isCocoaPodsIstalled()) { return { success: false } @@ -95,12 +96,16 @@ async function invokeiosBuild(args) { const username = await getUsername(); const keychainName = `wm-reactnative-${random}.keychain`; const provisionuuid = await extractUUID(provisionalFile); + + let codeSignIdentity = await exec(`openssl pkcs12 -in ${certificate} -passin pass:${certificatePassword} -nodes | openssl x509 -noout -subject -nameopt multiline | grep commonName | sed -n 's/ *commonName *= //p'`, null, { + shell: true + }); + codeSignIdentity = codeSignIdentity[1]; let useModernBuildSystem = 'YES'; logger.info({ label: loggerLabel, message: `provisional UUID : ${provisionuuid}` }); - const codeSignIdentity = buildType === 'release' ? "iPhone Distribution" : "iPhone Developer"; const developmentTeamId = await extractTeamId(provisionalFile); logger.info({ label: loggerLabel, @@ -110,11 +115,10 @@ async function invokeiosBuild(args) { fs.mkdirSync(ppFolder, { recursive: true }) - const targetProvisionsalPath = `${ppFolder}/${provisionuuid}.mobileprovision`; const removeKeyChain = await importCertToKeyChain(keychainName, certificate, certificatePassword); try { - await xcodebuild(codeSignIdentity, provisionuuid, developmentTeamId); + return await xcodebuild(args, codeSignIdentity, provisionuuid, developmentTeamId); } catch (e) { return { errors: e, @@ -151,23 +155,57 @@ async function updateInfoPlist(appName, PROVISIONING_UUID) { } }); } +const endWith = (str, suffix) => { + if (!str.endsWith(suffix)) { + return str += suffix; + } + return str; +}; -async function xcodebuild(CODE_SIGN_IDENTITY_VAL, PROVISIONING_UUID, DEVELOPMENT_TEAM) { - const appName = config.metaData.name; +function findFile(path, nameregex) { + const files = fs.readdirSync(path); + const f = files.find(f => f.match(nameregex)); + return f ? endWith(path, '/') + f : ''; +} + +async function xcodebuild(args, CODE_SIGN_IDENTITY_VAL, PROVISIONING_UUID, DEVELOPMENT_TEAM) { try { - await exec('xcodebuild', ['-workspace', appName + '.xcworkspace', '-scheme', appName, '-configuration', 'Release', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'DEVELOPMENT_TEAM=' + DEVELOPMENT_TEAM, 'CODE_SIGN_STYLE=Manual'], { + let xcworkspacePath = findFile(config.src + 'ios', /\.xcworkspace?/) || findFile(config.src + 'ios', /\.xcodeproj?/); + if (!xcworkspacePath) { + return { + errors: '.xcworkspace or .xcodeproj files are not found in ios directory', + success: false + } + } + const pathArr = xcworkspacePath.split('/'); + const xcworkspaceFileName = pathArr[pathArr.length - 1]; + const fileName = xcworkspaceFileName.split('.')[0]; + let _buildType; + if (args.buildType === 'development' || args.buildType === 'debug') { + _buildType = 'Debug'; + } else { + _buildType = 'Release'; + } + await exec('xcodebuild', ['-workspace', fileName + '.xcworkspace', '-scheme', fileName, '-configuration', _buildType, 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'DEVELOPMENT_TEAM=' + DEVELOPMENT_TEAM, 'CODE_SIGN_STYLE=Manual'], { cwd: config.src + 'ios' }); - - await exec('xcodebuild', ['-workspace', appName + '.xcworkspace', '-scheme', appName, '-configuration', 'Release', '-archivePath', 'build/' + appName + '.xcarchive', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'archive', 'CODE_SIGN_STYLE=Manual'], { + await exec('xcodebuild', ['-workspace', fileName + '.xcworkspace', '-scheme', fileName, '-configuration', _buildType, '-archivePath', 'build/' + fileName + '.xcarchive', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'archive', 'CODE_SIGN_STYLE=Manual'], { cwd: config.src + 'ios' }); - const status = await updateInfoPlist(appName, PROVISIONING_UUID); + const status = await updateInfoPlist(fileName, PROVISIONING_UUID); if (status === 'success') { - await exec('xcodebuild', ['-exportArchive', '-archivePath', 'build/' + appName + '.xcarchive', '-exportOptionsPlist', 'build/' + appName + '.xcarchive/Info.plist', '-exportPath', 'build'], { + await exec('xcodebuild', ['-exportArchive', '-archivePath', 'build/' + fileName + '.xcarchive', '-exportOptionsPlist', 'build/' + fileName + '.xcarchive/Info.plist', '-exportPath', 'build'], { cwd: config.src + 'ios' }); + const output = args.dest + 'output/ios/'; + const outputFilePath = `${output}${fileName}(${config.metaData.version}).${args.buildType}.ipa`; + fs.mkdirSync(output, {recursive: true}); + fs.copyFileSync(findFile(`${args.dest}ios/build/`, /\.ipa?/), outputFilePath); + return { + success: true, + output: outputFilePath + } } } catch (e) { return { From 5bbee3d98880f6422fe9a2a2ccf926e380bb8e29 Mon Sep 17 00:00:00 2001 From: bandhavya Date: Thu, 22 Jul 2021 16:04:41 +0530 Subject: [PATCH 12/49] Fixes: updated doc, include expo cli check in requirements --- README.md | 12 +++++------- src/command.js | 9 +++++---- src/requirements.js | 23 ++++++++++++++++++----- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 4f9d615..034a627 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ npm install -g https://github.com/wavemaker/wm-reactnative-cli - Yarn - Gradle 6 ([https://gradle.org/releases/](https://gradle.org/releases/)) - Expo cli 4.7.3 (npm install -g expo-cli@4.7.3) -- react-native 0.63.4 (npm install -g react-native-cli@0.63.4) +- react-native-cli 2.0.1, react-native 0.63.4 (npm install -g react-native-cli) - Make sure JAVA_HOME, ANDROID_SDK and GRADLE_HOME are set in the environment variables and also in PATH. ### Command @@ -32,7 +32,6 @@ wm-reactnative build android [additional_arguments] |                   **Argument**                   | **Description** | |--|--| | **src_dir** | **DEFAULT:** current working directory.
Path to the reactnative expo zip (or) path to the reactnative expo project folder. | -| **\-\-localrnruntimepath** |**OPTIONAL:** local app-rn-runtime path | |**\-\-dest**|**OPTIONAL:** directory where the app has to be copied and built. If it is not specified then .wm-reactnative-cli folder inside the home directory, will contain the build folders | |**\-\-auto-eject**|**OPTIONAL:** On setting this flag to true, expo eject will be invoke automatically.| |**\-\-aKeyStore**|Absolute path of the key store. If keystore is not given then android debug key is used.| @@ -66,11 +65,11 @@ wm-reactnative build android "/path/to/src" \ - MAC machine - Latest XCODE - CocoaPods ([https://guides.cocoapods.org/using/getting-started.html#toc_3](https://guides.cocoapods.org/using/getting-started.html#toc_3)) -- Node 10.x ([https://nodejs.org/en/blog/release/v10.18.0/](https://nodejs.org/en/download/)) +- Node 12.x ([https://nodejs.org/en/blog/release/v12.22.0/](https://nodejs.org/en/download/)) - GIT ([https://git-scm.com/download/mac](https://git-scm.com/download/mac)) - Yarn - Expo cli 4.7.3 (npm install -g expo-cli@4.7.3) -- react-native 0.63.4 (npm install -g react-native-cli@0.63.4) +- react-native-cli 2.0.1, react-native 0.63.4 (npm install -g react-native-cli) - Apple developer or distribution P12 certificates - Provisioning profile - Install wm-reactnative-cli (npm install -g @wavemaker/wm-reactnative-cli) @@ -87,14 +86,13 @@ wm-reactnative build ios [additional_arguments] |                   **Argument**                     | **Description** | |--|--| | **src_dir** | **DEFAULT:** current working directory.
Path to the reactnative expo zip (or) path to the reactnative expo project folder. | -| **\-\-localrnruntimepath** |**OPTIONAL:** local app-rn-runtime path | |**\-\-dest**|**OPTIONAL:** directory where the app has to be copied and built. If it is not specified then .wm-reactnative-cli folder inside the home directory, will contain the build folders | |**\-\-auto-eject**|**OPTIONAL:** On setting this flag to true, expo eject will be invoke automatically.| |**\-\-iCertificate**|Absolute path of P12 certificate location| |**\-\-iCertificatePassword**|Password to unlock the certificate.| |**\-\-iProvisioningFile**|Absolute path of provisioning file| |**\-\-iCodeSigningIdentity**|Signing certificate name in keychain access| -|**\-\-packageType**|**DEFAULT:** development
development or production
Use ‘production’ with an AppStore distribution certificate.| +|**\-\-buildType**|**DEFAULT:** development
development or production
Use ‘production’ with an AppStore distribution certificate.| ### Example @@ -106,7 +104,7 @@ wm-reactnative build ios "/path/to/src" \ --iCertificatePassword="unlock_password" \ --iProvisioningFile="/path/to/profile.mobileprovision" \ --iCodeSigningIdentity="certificate name in keychain access" \ ---packageType="production" +--buildType="production" ~~~ diff --git a/src/command.js b/src/command.js index a95efd2..bce4ed9 100644 --- a/src/command.js +++ b/src/command.js @@ -4,7 +4,6 @@ const plist = require('plist'); const path = require('path'); const android = require('./android'); const { showConfirmation } = require('./requirements'); -const execa = require('execa'); const { exec @@ -16,6 +15,8 @@ const { checkForGradleAvailability, isGitInstalled, hasYarnPackage, + hasValidRNVersion, + hasValidExpoVersion } = require('./requirements'); const config = require('./config'); @@ -149,7 +150,7 @@ async function updateAppJsonFile(content, appId, src) { } else if (config.platform === 'ios') { updateExpoplistFile(); - await execa('pod', ['install'], { + await exec('pod', ['install'], { cwd: config.src + 'ios' }); result = await invokeiosBuild(args); @@ -313,7 +314,7 @@ async function ejectProject(args) { config.buildType = args.buildType; if (!await hasValidNodeVersion() || !await hasValidJavaVersion() || !await hasYarnPackage() || - !await checkForGradleAvailability() || !await isGitInstalled()) { + !await checkForGradleAvailability() || !await isGitInstalled() || !await hasValidExpoVersion()) { return { errors: 'check if all prerequisites are installed.', success: false @@ -348,7 +349,7 @@ async function ejectProject(args) { 'label': loggerLabel, 'message': 'invoking expo eject' }); - await execa('expo', ['eject'], { + await exec('expo', ['eject'], { cwd: config.src }); logger.info({ diff --git a/src/requirements.js b/src/requirements.js index 7c51541..60bb82b 100644 --- a/src/requirements.js +++ b/src/requirements.js @@ -11,13 +11,14 @@ const loggerLabel = 'rn-cli-requirements'; const VERSIONS = { 'NODE': '12.0.0', 'POD' : '1.9.0', - 'JAVA': '1.8.0' + 'JAVA': '1.8.0', + 'REACT_NATIVE': '0.63.4', + 'EXPO': '4.7.3', } -let projectSrc; // check if expo cli is installed globally or not // gradle check -async function checkAvailability(cmd, transformFn) { +async function checkAvailability(cmd, transformFn, projectSrc) { try { let options = {}; if (projectSrc) { @@ -139,6 +140,17 @@ async function hasValidNodeVersion() { return await checkAvailability('node'); } +async function hasValidExpoVersion() { + return await checkAvailability('expo'); +} + +async function hasValidRNVersion(projectSrc) { + // return await checkAvailability('react-native', o => { + // console.log(o); + // o && o.substring(o.indexOf('Gradle')) + // }, projectSrc); +} + function validateForAndroid(keyStore, storePassword, keyAlias, keyPassword) { let errors = []; if (!(keyStore && fs.existsSync(keyStore))) { @@ -204,7 +216,8 @@ module.exports = { hasValidJavaVersion: hasValidJavaVersion, showConfirmation: showConfirmation, checkForAndroidStudioAvailability: checkForAndroidStudioAvailability, - checkForGradleAvailability: checkForGradleAvailability + checkForGradleAvailability: checkForGradleAvailability, + hasValidExpoVersion: hasValidExpoVersion, + hasValidRNVersion: hasValidRNVersion } -// TODO check for expo-cli, react-native // TODO: support for multiple react native versions. From 0cc1a1e3bf76e08dd7851cb999fc6d6b42884183 Mon Sep 17 00:00:00 2001 From: bandhavya Date: Sun, 25 Jul 2021 15:39:23 +0530 Subject: [PATCH 13/49] Localrnruntime is specified, but content is copied and replaced by expo eject later on. Hence copying task is performed later --- src/command.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/command.js b/src/command.js index bce4ed9..a9e8003 100644 --- a/src/command.js +++ b/src/command.js @@ -15,7 +15,6 @@ const { checkForGradleAvailability, isGitInstalled, hasYarnPackage, - hasValidRNVersion, hasValidExpoVersion } = require('./requirements'); @@ -328,19 +327,6 @@ async function ejectProject(args) { await exec('yarn', ['install'], { cwd: config.src }); - if (args.localrnruntimepath) { - const linkFolderPath = config.src + 'node_modules/@wavemaker/app-rn-runtime'; - // using removeSync when target is directory and unlinkSync works when target is file. - if (fs.existsSync(linkFolderPath)) { - fs.removeSync(linkFolderPath); - } - await fs.mkdirsSync(linkFolderPath); - await fs.copySync(args.localrnruntimepath, linkFolderPath); - logger.info({ - 'label': loggerLabel, - 'message': 'copied the app-rn-runtime folder' - }) - } // expo eject checks whether src is a git repo or not await exec('git', ['init'], { cwd: config.src @@ -356,6 +342,19 @@ async function ejectProject(args) { 'label': loggerLabel, 'message': 'expo eject succeeded' }); + if (args.localrnruntimepath) { + const linkFolderPath = config.src + 'node_modules/@wavemaker/app-rn-runtime'; + // using removeSync when target is directory and unlinkSync works when target is file. + if (fs.existsSync(linkFolderPath)) { + fs.removeSync(linkFolderPath); + } + await fs.mkdirsSync(linkFolderPath); + await fs.copySync(args.localrnruntimepath, linkFolderPath); + logger.info({ + 'label': loggerLabel, + 'message': 'copied the app-rn-runtime folder' + }) + } await writeWmRNConfig({ejected: true}); } catch (e) { logger.error({ From edcb4d9e6dece05b7262fe88a5ed41ec744d87ca Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Tue, 27 Jul 2021 16:52:17 +0530 Subject: [PATCH 14/49] log of expo eject failure is not captured in a file. --- .gitignore | 4 + package-lock.json | 515 ++++++++++++++++++++++++++++++++++++---------- src/command.js | 12 +- 3 files changed, 417 insertions(+), 114 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8e37c13 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules +.vscode +ws +.DS_Store diff --git a/package-lock.json b/package-lock.json index 7bdd517..83b55be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,9 +12,9 @@ "execa": "^4.0.3", "fs-extra": "^9.0.1", "plist": "^3.0.2", + "prompt": "^1.0.0", "semver": "^7.3.2", "winston": "^3.3.3", - "xcode": "^3.0.1", "yargs": "^15.4.0", "yarn": "^1.22.10" }, @@ -79,6 +79,11 @@ "node": ">= 4.0.0" } }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -98,31 +103,13 @@ } ] }, - "node_modules/big-integer": { - "version": "1.6.48", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", - "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/bplist-creator": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.8.tgz", - "integrity": "sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA==", - "dependencies": { - "stream-buffers": "~2.2.0" - } - }, - "node_modules/bplist-parser": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", - "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dependencies": { - "big-integer": "^1.6.44" - }, - "engines": { - "node": ">= 5.10.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "node_modules/camelcase": { @@ -207,6 +194,11 @@ "text-hex": "1.0.x" } }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, "node_modules/core-js-pure": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.14.0.tgz", @@ -235,6 +227,14 @@ "node": ">= 8" } }, + "node_modules/cycle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", + "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/decamelize": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-3.2.0.tgz", @@ -246,6 +246,11 @@ "node": ">=6" } }, + "node_modules/deep-equal": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz", + "integrity": "sha1-hLdFiW80xoTpjyzg5Cq69Du6AX0=" + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -286,6 +291,14 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", + "engines": { + "node": "> 0.1.90" + } + }, "node_modules/fast-safe-stringify": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", @@ -327,6 +340,11 @@ "node": ">=10" } }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -349,6 +367,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dependencies": { + "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" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/graceful-fs": { "version": "4.2.6", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", @@ -362,6 +399,23 @@ "node": ">=8.12.0" } }, + "node_modules/i": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", + "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -398,6 +452,11 @@ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -469,11 +528,51 @@ "node": ">=6" } }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + }, + "node_modules/ncp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz", + "integrity": "sha1-0VNn5cuHQyuhF9K/gP30Wuz7QkY=", + "bin": { + "ncp": "bin/ncp" + } + }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -556,6 +655,14 @@ "node": ">=8" } }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -582,6 +689,50 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "node_modules/prompt": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/prompt/-/prompt-1.1.0.tgz", + "integrity": "sha512-ec1vUPXCplDBDUVD8uPa3XGA+OzLrO40Vxv3F1uxoiZGkZhdctlK2JotcHq5X6ExjocDOGwGdCSXloGNyU5L1Q==", + "dependencies": { + "colors": "^1.1.2", + "read": "1.0.x", + "revalidator": "0.1.x", + "utile": "0.3.x", + "winston": "2.x" + }, + "engines": { + "node": ">= 0.6.6" + } + }, + "node_modules/prompt/node_modules/async": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", + "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=" + }, + "node_modules/prompt/node_modules/winston": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.5.tgz", + "integrity": "sha512-TWoamHt5yYvsMarGlGEQE59SbJHqGsZV8/lwC+iCcGeAe0vUaOh+Lv6SYM17ouzC/a/LB1/hz/7sxFBtlu1l4A==", + "dependencies": { + "async": "~1.0.0", + "colors": "1.0.x", + "cycle": "1.0.x", + "eyes": "0.1.x", + "isstream": "0.1.x", + "stack-trace": "0.0.x" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/prompt/node_modules/winston/node_modules/colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -591,6 +742,17 @@ "once": "^1.3.1" } }, + "node_modules/read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", + "dependencies": { + "mute-stream": "~0.0.4" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -622,6 +784,25 @@ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, + "node_modules/revalidator": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz", + "integrity": "sha1-/s5hv6DBtSoga9axgZgYS91SOjs=", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -684,16 +865,6 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, - "node_modules/simple-plist": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.1.1.tgz", - "integrity": "sha512-pKMCVKvZbZTsqYR6RKgLfBHkh2cV89GXcA/0CVPje3sOiNOnXA8+rp/ciAMZ7JRaUdLzlEM6JFfUn+fS6Nt3hg==", - "dependencies": { - "bplist-creator": "0.0.8", - "bplist-parser": "0.2.0", - "plist": "^3.0.1" - } - }, "node_modules/simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -710,14 +881,6 @@ "node": "*" } }, - "node_modules/stream-buffers": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz", - "integrity": "sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ=", - "engines": { - "node": ">= 0.10.0" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -781,14 +944,27 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "node_modules/uuid": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", - "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==", - "bin": { - "uuid": "dist/bin/uuid" + "node_modules/utile": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/utile/-/utile-0.3.0.tgz", + "integrity": "sha1-E1LDQOuCDk2N26A5pPv6oy7U7zo=", + "dependencies": { + "async": "~0.9.0", + "deep-equal": "~0.2.1", + "i": "0.3.x", + "mkdirp": "0.x.x", + "ncp": "1.0.x", + "rimraf": "2.x.x" + }, + "engines": { + "node": ">= 0.8.0" } }, + "node_modules/utile/node_modules/async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -884,18 +1060,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "node_modules/xcode": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz", - "integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==", - "dependencies": { - "simple-plist": "^1.1.0", - "uuid": "^7.0.3" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/xmlbuilder": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", @@ -1028,30 +1192,23 @@ "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, - "big-integer": { - "version": "1.6.48", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", - "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==" - }, - "bplist-creator": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.8.tgz", - "integrity": "sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA==", + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "stream-buffers": "~2.2.0" - } - }, - "bplist-parser": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", - "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", - "requires": { - "big-integer": "^1.6.44" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "camelcase": { @@ -1129,6 +1286,11 @@ "text-hex": "1.0.x" } }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, "core-js-pure": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.14.0.tgz", @@ -1149,6 +1311,11 @@ "which": "^2.0.1" } }, + "cycle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", + "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=" + }, "decamelize": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-3.2.0.tgz", @@ -1157,6 +1324,11 @@ "xregexp": "^4.2.4" } }, + "deep-equal": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz", + "integrity": "sha1-hLdFiW80xoTpjyzg5Cq69Du6AX0=" + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -1191,6 +1363,11 @@ "strip-final-newline": "^2.0.0" } }, + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" + }, "fast-safe-stringify": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", @@ -1226,6 +1403,11 @@ "universalify": "^1.0.0" } }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -1239,6 +1421,19 @@ "pump": "^3.0.0" } }, + "glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "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" + } + }, "graceful-fs": { "version": "4.2.6", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", @@ -1249,6 +1444,20 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==" }, + "i": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", + "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1279,6 +1488,11 @@ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, "jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -1338,11 +1552,42 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "requires": { + "minimist": "^1.2.5" + } + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + }, + "ncp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz", + "integrity": "sha1-0VNn5cuHQyuhF9K/gP30Wuz7QkY=" + }, "npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -1401,6 +1646,11 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -1421,6 +1671,45 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "prompt": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/prompt/-/prompt-1.1.0.tgz", + "integrity": "sha512-ec1vUPXCplDBDUVD8uPa3XGA+OzLrO40Vxv3F1uxoiZGkZhdctlK2JotcHq5X6ExjocDOGwGdCSXloGNyU5L1Q==", + "requires": { + "colors": "^1.1.2", + "read": "1.0.x", + "revalidator": "0.1.x", + "utile": "0.3.x", + "winston": "2.x" + }, + "dependencies": { + "async": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", + "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=" + }, + "winston": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.5.tgz", + "integrity": "sha512-TWoamHt5yYvsMarGlGEQE59SbJHqGsZV8/lwC+iCcGeAe0vUaOh+Lv6SYM17ouzC/a/LB1/hz/7sxFBtlu1l4A==", + "requires": { + "async": "~1.0.0", + "colors": "1.0.x", + "cycle": "1.0.x", + "eyes": "0.1.x", + "isstream": "0.1.x", + "stack-trace": "0.0.x" + }, + "dependencies": { + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" + } + } + } + } + }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -1430,6 +1719,14 @@ "once": "^1.3.1" } }, + "read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", + "requires": { + "mute-stream": "~0.0.4" + } + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -1455,6 +1752,19 @@ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, + "revalidator": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz", + "integrity": "sha1-/s5hv6DBtSoga9axgZgYS91SOjs=" + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "requires": { + "glob": "^7.1.3" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1491,16 +1801,6 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, - "simple-plist": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.1.1.tgz", - "integrity": "sha512-pKMCVKvZbZTsqYR6RKgLfBHkh2cV89GXcA/0CVPje3sOiNOnXA8+rp/ciAMZ7JRaUdLzlEM6JFfUn+fS6Nt3hg==", - "requires": { - "bplist-creator": "0.0.8", - "bplist-parser": "0.2.0", - "plist": "^3.0.1" - } - }, "simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -1514,11 +1814,6 @@ "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" }, - "stream-buffers": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz", - "integrity": "sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ=" - }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -1570,10 +1865,25 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "uuid": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", - "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==" + "utile": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/utile/-/utile-0.3.0.tgz", + "integrity": "sha1-E1LDQOuCDk2N26A5pPv6oy7U7zo=", + "requires": { + "async": "~0.9.0", + "deep-equal": "~0.2.1", + "i": "0.3.x", + "mkdirp": "0.x.x", + "ncp": "1.0.x", + "rimraf": "2.x.x" + }, + "dependencies": { + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" + } + } }, "which": { "version": "2.0.2", @@ -1657,15 +1967,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "xcode": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz", - "integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==", - "requires": { - "simple-plist": "^1.1.0", - "uuid": "^7.0.3" - } - }, "xmlbuilder": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", diff --git a/src/command.js b/src/command.js index a9e8003..bc532f2 100644 --- a/src/command.js +++ b/src/command.js @@ -129,14 +129,7 @@ async function updateAppJsonFile(content, appId, src) { config.src = args.dest; } config.outputDirectory = config.src + 'output/'; - fs.mkdirSync(config.outputDirectory, { - recursive: true - }); config.logDirectory = config.outputDirectory + 'logs/'; - fs.mkdirSync(config.logDirectory, { - recursive: true - }); - logger.setLogDirectory(config.logDirectory); logger.info({ label: loggerLabel, message: `Building at : ${config.src}` @@ -206,6 +199,11 @@ async function setupBuildDirectory(src, dest) { } fs.mkdirsSync(target); fs.copySync(src, dest); + const logDirectory = dest + 'output/logs/'; + fs.mkdirSync(logDirectory, { + recursive: true + }); + logger.setLogDirectory(logDirectory); } async function getDefaultDestination() { From c1ccab8d940e87a25f2b9b99727038dbb0d9b072 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Tue, 27 Jul 2021 17:53:13 +0530 Subject: [PATCH 15/49] unzip if a zip file is given --- src/command.js | 212 ++++++++++++++++++++++++++----------------------- 1 file changed, 114 insertions(+), 98 deletions(-) diff --git a/src/command.js b/src/command.js index bc532f2..bd88edb 100644 --- a/src/command.js +++ b/src/command.js @@ -103,6 +103,15 @@ async function updateAppJsonFile(content, appId, src) { } async function build(args) { + const directories = await setupBuildDirectory(args.src, args.dest, args.appId); + if (!directories) { + return { + success : false, + errors: 'could not setup the build directories.' + }; + } + args.src = directories.src; + args.dest = directories.dest if (!args.autoEject) { const response = await showConfirmation('Would you like to eject the expo project (yes/no) ?'); if (response !== 'y' && response !== 'yes') { @@ -180,30 +189,73 @@ async function updateAppJsonFile(content, appId, src) { } } -async function setupBuildDirectory(src, dest) { - const target = dest; - if (fs.existsSync(target)) { - if (fs.readdirSync(target).length) { +async function extractRNZip(src) { + let folderName = src.split('/').pop(); + const isZipFile = folderName.endsWith('.zip'); + + folderName = isZipFile ? folderName.replace('.zip', '') : folderName; + + const tmp = `${require('os').homedir()}/.wm-reactnative-cli/temp/${folderName}/${Date.now()}`; + + if (src.endsWith('.zip')) { + const zipFile = src; + src = tmp + '/src'; + + if (!fs.existsSync(src)) { + fs.mkdirsSync(src); + } + + await exec('unzip', [ + '-o', + zipFile, + '-d', + src + ]); + } + return path.resolve(src) + '/'; +} + +async function setupBuildDirectory(src, dest, appId) { + src = await extractRNZip(src); + if (fs.existsSync(dest)) { + if (fs.readdirSync(dest).length) { const response = await showConfirmation('Would you like to empty the dest folder (i.e. ' + dest + ') (yes/no) ?'); if (response !== 'y' && response !== 'yes') { - process.exit(); + logger.error({ + label: loggerLabel, + message: 'source and destination folders are same. Please choose a different destination.' + }); + return; } - // using removeSync when target is directory and unlinkSync works when target is file. - const fsStat = fs.lstatSync(target); + // using removeSync when dest is directory and unlinkSync works when dest is file. + const fsStat = fs.lstatSync(dest); if (fsStat.isDirectory()) { - fs.removeSync(target); + fs.removeSync(dest); } else if (fsStat.isFile()) { - fs.unlinkSync(target); + fs.unlinkSync(dest); } } } - fs.mkdirsSync(target); + dest = dest || await getDefaultDestination(appId); + dest = path.resolve(dest) + '/'; + if(src === dest) { + logger.error({ + label: loggerLabel, + message: 'source and destination folders are same. Please choose a different destination.' + }); + return; + } + fs.mkdirsSync(dest); fs.copySync(src, dest); const logDirectory = dest + 'output/logs/'; fs.mkdirSync(logDirectory, { recursive: true }); logger.setLogDirectory(logDirectory); + return { + src: src, + dest: dest + }; } async function getDefaultDestination() { @@ -263,104 +315,68 @@ async function writeWmRNConfig(content) { // src points to unzip proj async function ejectProject(args) { try { - let folderName = args.src.split('/').pop(); - const isZipFile = folderName.endsWith('.zip'); - - folderName = isZipFile ? folderName.replace('.zip', '') : folderName; - - const tmp = `${require('os').homedir()}/.wm-reactnative-cli/temp/${folderName}/${Date.now()}`; - - if (args.src.endsWith('.zip')) { - const zipFile = args.src; - args.src = tmp + '/src'; - - if (!fs.existsSync(args.src)) { - fs.mkdirsSync(args.src); - } - - await exec('unzip', [ - '-o', - zipFile, - '-d', - args.src - ]); - } - args.src = path.resolve(args.src) + '/'; - - if(!args.dest) { - args.dest = await getDefaultDestination(args.appId); - } - args.dest = path.resolve(args.dest) + '/'; - - if(args.src === args.dest) { - logger.error({ - label: loggerLabel, - message: 'source and destination folders are same. Please choose a different destination.' - }); - } - await setupBuildDirectory(args.src, args.dest); config.src = args.dest; logger.info({ label: loggerLabel, message: 'destination folder where app is build at ' + args.dest }) - if (!args.platform) { - args.platform = 'android'; - } - config.platform = args.platform; - config.buildType = args.buildType; - - if (!await hasValidNodeVersion() || !await hasValidJavaVersion() || !await hasYarnPackage() || - !await checkForGradleAvailability() || !await isGitInstalled() || !await hasValidExpoVersion()) { - return { - errors: 'check if all prerequisites are installed.', - success: false + if (!args.platform) { + args.platform = 'android'; } - } - await updateAppJsonFile({ - 'name': config.metaData.name, - 'slug': config.metaData.name - }, config.metaData.id, config.src); - await updatePackageJsonFile(config.src + 'package.json'); - await exec('yarn', ['install'], { - cwd: config.src - }); - // expo eject checks whether src is a git repo or not - await exec('git', ['init'], { - cwd: config.src - }); - logger.info({ - 'label': loggerLabel, - 'message': 'invoking expo eject' - }); - await exec('expo', ['eject'], { - cwd: config.src - }); - logger.info({ - 'label': loggerLabel, - 'message': 'expo eject succeeded' - }); - if (args.localrnruntimepath) { - const linkFolderPath = config.src + 'node_modules/@wavemaker/app-rn-runtime'; - // using removeSync when target is directory and unlinkSync works when target is file. - if (fs.existsSync(linkFolderPath)) { - fs.removeSync(linkFolderPath); + config.platform = args.platform; + config.buildType = args.buildType; + + if (!await hasValidNodeVersion() || !await hasValidJavaVersion() || !await hasYarnPackage() || + !await checkForGradleAvailability() || !await isGitInstalled() || !await hasValidExpoVersion()) { + return { + errors: 'check if all prerequisites are installed.', + success: false + } } - await fs.mkdirsSync(linkFolderPath); - await fs.copySync(args.localrnruntimepath, linkFolderPath); + await updateAppJsonFile({ + 'name': config.metaData.name, + 'slug': config.metaData.name + }, config.metaData.id, config.src); + await updatePackageJsonFile(config.src + 'package.json'); + await exec('yarn', ['install'], { + cwd: config.src + }); + // expo eject checks whether src is a git repo or not + await exec('git', ['init'], { + cwd: config.src + }); logger.info({ 'label': loggerLabel, - 'message': 'copied the app-rn-runtime folder' - }) + 'message': 'invoking expo eject' + }); + await exec('expo', ['eject'], { + cwd: config.src + }); + logger.info({ + 'label': loggerLabel, + 'message': 'expo eject succeeded' + }); + if (args.localrnruntimepath) { + const linkFolderPath = config.src + 'node_modules/@wavemaker/app-rn-runtime'; + // using removeSync when target is directory and unlinkSync works when target is file. + if (fs.existsSync(linkFolderPath)) { + fs.removeSync(linkFolderPath); + } + await fs.mkdirsSync(linkFolderPath); + await fs.copySync(args.localrnruntimepath, linkFolderPath); + logger.info({ + 'label': loggerLabel, + 'message': 'copied the app-rn-runtime folder' + }) + } + await writeWmRNConfig({ejected: true}); + } catch (e) { + logger.error({ + label: loggerLabel, + message: args.platform + ' eject project Failed. Due to :' + e + }); + return { errors: e, success : false }; } - await writeWmRNConfig({ejected: true}); -} catch (e) { - logger.error({ - label: loggerLabel, - message: args.platform + ' eject project Failed. Due to :' + e - }); - return { errors: e, success : false }; -} } module.exports = { From 7fd77ec2d41b9ffa0cf3550ba9ab098644aea7ea Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Tue, 27 Jul 2021 17:53:13 +0530 Subject: [PATCH 16/49] unzip if a zip file is given --- src/command.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/command.js b/src/command.js index bd88edb..27bc7d8 100644 --- a/src/command.js +++ b/src/command.js @@ -103,7 +103,7 @@ async function updateAppJsonFile(content, appId, src) { } async function build(args) { - const directories = await setupBuildDirectory(args.src, args.dest, args.appId); + const directories = await setupBuildDirectory(args.src, args.dest); if (!directories) { return { success : false, @@ -215,8 +215,9 @@ async function extractRNZip(src) { return path.resolve(src) + '/'; } -async function setupBuildDirectory(src, dest, appId) { +async function setupBuildDirectory(src, dest) { src = await extractRNZip(src); + const metadata = await readWmRNConfig(src); if (fs.existsSync(dest)) { if (fs.readdirSync(dest).length) { const response = await showConfirmation('Would you like to empty the dest folder (i.e. ' + dest + ') (yes/no) ?'); @@ -236,7 +237,7 @@ async function setupBuildDirectory(src, dest, appId) { } } } - dest = dest || await getDefaultDestination(appId); + dest = dest || await getDefaultDestination(metadata.id); dest = path.resolve(dest) + '/'; if(src === dest) { logger.error({ @@ -258,8 +259,7 @@ async function setupBuildDirectory(src, dest, appId) { }; } -async function getDefaultDestination() { - const id = config.metaData.id; +async function getDefaultDestination(id) { const version = '1.0.0'; const path = `${require('os').homedir()}/.wm-reactnative-cli/build/${id}/${version}/`; fs.mkdirSync(path, { From e73f1f06ee85b009026bfd8e47d5357288521315 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Tue, 27 Jul 2021 21:25:38 +0530 Subject: [PATCH 17/49] added platform specific folders --- src/command.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/command.js b/src/command.js index 27bc7d8..b1dd845 100644 --- a/src/command.js +++ b/src/command.js @@ -103,7 +103,7 @@ async function updateAppJsonFile(content, appId, src) { } async function build(args) { - const directories = await setupBuildDirectory(args.src, args.dest); + const directories = await setupBuildDirectory(args.src, args.dest, args.platform); if (!directories) { return { success : false, @@ -215,7 +215,7 @@ async function extractRNZip(src) { return path.resolve(src) + '/'; } -async function setupBuildDirectory(src, dest) { +async function setupBuildDirectory(src, dest, platform) { src = await extractRNZip(src); const metadata = await readWmRNConfig(src); if (fs.existsSync(dest)) { @@ -237,7 +237,7 @@ async function setupBuildDirectory(src, dest) { } } } - dest = dest || await getDefaultDestination(metadata.id); + dest = dest || await getDefaultDestination(metadata.id, platform); dest = path.resolve(dest) + '/'; if(src === dest) { logger.error({ @@ -259,9 +259,9 @@ async function setupBuildDirectory(src, dest) { }; } -async function getDefaultDestination(id) { +async function getDefaultDestination(id, platform) { const version = '1.0.0'; - const path = `${require('os').homedir()}/.wm-reactnative-cli/build/${id}/${version}/`; + const path = `${require('os').homedir()}/.wm-reactnative-cli/build/${id}/${version}/${platform}`; fs.mkdirSync(path, { recursive: true }); From c6ba638a323d67c6497f582ed5206f03e30ad075 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Tue, 27 Jul 2021 21:26:04 +0530 Subject: [PATCH 18/49] disabled push notifications --- src/ios.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ios.js b/src/ios.js index a0c10b1..bd3caa6 100644 --- a/src/ios.js +++ b/src/ios.js @@ -1,7 +1,7 @@ const fs = require('fs-extra'); const logger = require('./logger'); const config = require('./config'); - +const plist = require('plist'); const { exec } = require('./exec'); @@ -155,6 +155,19 @@ async function updateInfoPlist(appName, PROVISIONING_UUID) { } }); } + +const removePushNotifications = (projectDir, projectName) => { + const dir = `${projectDir}ios/${projectName}/`; + const entitlements = dir + fs.readdirSync(dir).find(f => f.endsWith('entitlements')); + const o = plist.parse(fs.readFileSync(entitlements, 'utf8')); + delete o['aps-environment']; + fs.writeFileSync(entitlements, plist.build(o), 'utf8'); + logger.info({ + label: loggerLabel, + message: `removed aps-environment from entitlements` + }); +}; + const endWith = (str, suffix) => { if (!str.endsWith(suffix)) { return str += suffix; @@ -180,6 +193,7 @@ async function xcodebuild(args, CODE_SIGN_IDENTITY_VAL, PROVISIONING_UUID, DEVEL const pathArr = xcworkspacePath.split('/'); const xcworkspaceFileName = pathArr[pathArr.length - 1]; const fileName = xcworkspaceFileName.split('.')[0]; + removePushNotifications(config.src, config.metaData.name); let _buildType; if (args.buildType === 'development' || args.buildType === 'debug') { _buildType = 'Debug'; From 3ffa2bd1be6934374447567298a3fdfc50eb6889 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Tue, 27 Jul 2021 22:51:59 +0530 Subject: [PATCH 19/49] disable metro server auto start --- src/ios.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ios.js b/src/ios.js index bd3caa6..49fe9f4 100644 --- a/src/ios.js +++ b/src/ios.js @@ -200,17 +200,23 @@ async function xcodebuild(args, CODE_SIGN_IDENTITY_VAL, PROVISIONING_UUID, DEVEL } else { _buildType = 'Release'; } + const env = { + RCT_NO_LAUNCH_PACKAGER: 1 + }; await exec('xcodebuild', ['-workspace', fileName + '.xcworkspace', '-scheme', fileName, '-configuration', _buildType, 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'DEVELOPMENT_TEAM=' + DEVELOPMENT_TEAM, 'CODE_SIGN_STYLE=Manual'], { - cwd: config.src + 'ios' + cwd: config.src + 'ios', + env: env }); await exec('xcodebuild', ['-workspace', fileName + '.xcworkspace', '-scheme', fileName, '-configuration', _buildType, '-archivePath', 'build/' + fileName + '.xcarchive', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'archive', 'CODE_SIGN_STYLE=Manual'], { - cwd: config.src + 'ios' + cwd: config.src + 'ios', + env: env }); const status = await updateInfoPlist(fileName, PROVISIONING_UUID); if (status === 'success') { await exec('xcodebuild', ['-exportArchive', '-archivePath', 'build/' + fileName + '.xcarchive', '-exportOptionsPlist', 'build/' + fileName + '.xcarchive/Info.plist', '-exportPath', 'build'], { - cwd: config.src + 'ios' + cwd: config.src + 'ios', + env: env }); const output = args.dest + 'output/ios/'; const outputFilePath = `${output}${fileName}(${config.metaData.version}).${args.buildType}.ipa`; From 6f62a4808c693127d542cfb607b4d1d1120809fa Mon Sep 17 00:00:00 2001 From: bandhavya Date: Fri, 30 Jul 2021 14:36:03 +0530 Subject: [PATCH 20/49] Fix for enableHermes, appicon is not changing on update., adding camera plugin --- src/android.js | 5 ++++- src/command.js | 28 +++++++++++++++++++++++----- src/config.js | 11 ++--------- src/requirements.js | 10 +--------- 4 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/android.js b/src/android.js index 9a07da3..1ad3961 100644 --- a/src/android.js +++ b/src/android.js @@ -98,6 +98,10 @@ async function generateAab(packageType) { function setDebugFlagInGradle(content) { let newContent; + // enableHermes option will always be there in the content, hence just set to true / false depending on preference value. + if (content.search(`enableHermes:`) !== -1 && config.metaData.preferences) { + content = content.replace(/enableHermes\: (true|false)/gm, `enableHermes: ${config.metaData.preferences.enableHermes}`); + } if (content.search(`entryFile: "index.js"`) === -1) { newContent = content.replace(/^(?!\s)project\.ext\.react = \[/gm, `project.ext.react = [ entryFile: "index.js", @@ -108,7 +112,6 @@ function setDebugFlagInGradle(content) { newContent = content.replace(/bundleInDebug\: false/gm, `bundleInDebug: true`) .replace(/devDisabledInDebug\: false/gm, `devDisabledInDebug: true`) .replace(/bundleInRelease\: true/gm, `bundleInRelease: false`); - } return newContent; } diff --git a/src/command.js b/src/command.js index b1dd845..174187a 100644 --- a/src/command.js +++ b/src/command.js @@ -50,6 +50,7 @@ async function updatePackageJsonFile(path) { } var jsonData = JSON.parse(data); jsonData['main'] = "index"; + delete jsonData['dependencies']['expo-image-picker']; await fs.writeFile(path, JSON.stringify(jsonData), error => { if (error) { throw error; @@ -67,7 +68,7 @@ async function updatePackageJsonFile(path) { }) } -async function updateAppJsonFile(content, appId, src) { +async function updateAppJsonFile(content, src) { return await new Promise(resolve => { try { const path = (src || config.src) + 'app.json'; @@ -80,9 +81,14 @@ async function updateAppJsonFile(content, appId, src) { if (content) { Object.assign(jsonData['expo'], content); } - if (appId) { - jsonData['expo']['android']['package'] = appId; - jsonData['expo']['ios']['bundleIdentifier'] = appId; + if (config.metaData.id) { + jsonData['expo']['android']['package'] = config.metaData.id; + jsonData['expo']['ios']['bundleIdentifier'] = config.metaData.id; + } + if (config.metaData.icon) { + jsonData['expo']['icon'] = config.metaData.icon.src; + jsonData['expo']['splash']['image'] = config.metaData.splash.src; + jsonData['expo']['android']['adaptiveIcon']['foregroundImage'] = config.metaData.icon.src; } await fs.writeFile(path, JSON.stringify(jsonData), error => { if (error) { @@ -119,6 +125,14 @@ async function updateAppJsonFile(content, appId, src) { } } config.metaData = await readWmRNConfig(args.src); + + if (config.metaData.icon.src.startsWith('resources')) { + config.metaData.icon.src = 'src/' + config.metaData.icon.src; + } + if (config.metaData.splash.src.startsWith('resources')) { + config.metaData.splash.src = 'src/' + config.metaData.splash.src; + } + config.platform = args.platform; let response; if (args.dest) { @@ -336,7 +350,7 @@ async function ejectProject(args) { await updateAppJsonFile({ 'name': config.metaData.name, 'slug': config.metaData.name - }, config.metaData.id, config.src); + }, config.src); await updatePackageJsonFile(config.src + 'package.json'); await exec('yarn', ['install'], { cwd: config.src @@ -352,6 +366,10 @@ async function ejectProject(args) { await exec('expo', ['eject'], { cwd: config.src }); + // TODO: plugin addition, remove later + await exec('expo', ['install', 'expo-image-picker'], { + cwd: config.src + }); logger.info({ 'label': loggerLabel, 'message': 'expo eject succeeded' diff --git a/src/config.js b/src/config.js index 08af497..cfcad2e 100644 --- a/src/config.js +++ b/src/config.js @@ -6,12 +6,5 @@ module.exports = { buildType: '', logDirectory: '', outputDirectory: '', - metaData: {}, - setMetaInfo: function(src) { - console.log('into fn src ..' + src); - src = path.resolve(src) + '/'; - const jsonPath = src + 'app.json'; - let data = fs.readFileSync(jsonPath); - return JSON.parse(data); - } -}; \ No newline at end of file + metaData: {} +}; diff --git a/src/requirements.js b/src/requirements.js index 60bb82b..903ad49 100644 --- a/src/requirements.js +++ b/src/requirements.js @@ -144,13 +144,6 @@ async function hasValidExpoVersion() { return await checkAvailability('expo'); } -async function hasValidRNVersion(projectSrc) { - // return await checkAvailability('react-native', o => { - // console.log(o); - // o && o.substring(o.indexOf('Gradle')) - // }, projectSrc); -} - function validateForAndroid(keyStore, storePassword, keyAlias, keyPassword) { let errors = []; if (!(keyStore && fs.existsSync(keyStore))) { @@ -217,7 +210,6 @@ module.exports = { showConfirmation: showConfirmation, checkForAndroidStudioAvailability: checkForAndroidStudioAvailability, checkForGradleAvailability: checkForGradleAvailability, - hasValidExpoVersion: hasValidExpoVersion, - hasValidRNVersion: hasValidRNVersion + hasValidExpoVersion: hasValidExpoVersion } // TODO: support for multiple react native versions. From 490be49dee98541d41a23034ec9c141cfa2ff8bb Mon Sep 17 00:00:00 2001 From: bandhavya Date: Tue, 31 Aug 2021 14:46:16 +0530 Subject: [PATCH 21/49] Fixes: android and ios build refactoring and updating build tools version to 4.0.1 --- src/android.js | 16 +++++++++++++--- src/command.js | 7 +------ src/ios.js | 6 +----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/android.js b/src/android.js index 1ad3961..f08c520 100644 --- a/src/android.js +++ b/src/android.js @@ -143,6 +143,18 @@ function findFile(path, nameregex) { return endWith(path, '/') + f; } +async function updateToolsInBuildGradleFile() { + const path = config.src + 'android/build.gradle'; + let data = fs.readFileSync(path, 'utf8'); + console.log(data); + + let content = fs.readFileSync(path, 'utf8'); + // TODO update the version only when version is less than 4.0.1 and gradle-properties distributionUrl - 6.3.0 + content = content.replace(/com.android.tools.build:gradle:(\d+)\.(\d+)\.\d+/gm, 'com.android.tools.build:gradle:4.0.1'); + + await fs.writeFileSync(path, content); +} + async function updateAndroidBuildGradleFile(type) { const path = config.src + 'android/app/build.gradle'; let data = fs.readFileSync(path, 'utf8'); @@ -198,14 +210,12 @@ async function invokeAndroidBuild(args) { await generateSignedApk(keyStore, storePassword, keyAlias, keyPassword, args.packageType); } else { await updateAndroidBuildGradleFile(args.buildType); + await updateToolsInBuildGradleFile(); logger.info({ label: loggerLabel, message: 'Updated build.gradle file with debug configuration' }); try { - await exec('./gradlew', ['clean'], { - cwd: config.src + 'android' - }); await exec('./gradlew', ['assembleDebug'], { cwd: config.src + 'android' }); diff --git a/src/command.js b/src/command.js index 174187a..66f85aa 100644 --- a/src/command.js +++ b/src/command.js @@ -50,7 +50,6 @@ async function updatePackageJsonFile(path) { } var jsonData = JSON.parse(data); jsonData['main'] = "index"; - delete jsonData['dependencies']['expo-image-picker']; await fs.writeFile(path, JSON.stringify(jsonData), error => { if (error) { throw error; @@ -132,7 +131,7 @@ async function updateAppJsonFile(content, src) { if (config.metaData.splash.src.startsWith('resources')) { config.metaData.splash.src = 'src/' + config.metaData.splash.src; } - + config.platform = args.platform; let response; if (args.dest) { @@ -366,10 +365,6 @@ async function ejectProject(args) { await exec('expo', ['eject'], { cwd: config.src }); - // TODO: plugin addition, remove later - await exec('expo', ['install', 'expo-image-picker'], { - cwd: config.src - }); logger.info({ 'label': loggerLabel, 'message': 'expo eject succeeded' diff --git a/src/ios.js b/src/ios.js index 49fe9f4..30b85d1 100644 --- a/src/ios.js +++ b/src/ios.js @@ -193,7 +193,7 @@ async function xcodebuild(args, CODE_SIGN_IDENTITY_VAL, PROVISIONING_UUID, DEVEL const pathArr = xcworkspacePath.split('/'); const xcworkspaceFileName = pathArr[pathArr.length - 1]; const fileName = xcworkspaceFileName.split('.')[0]; - removePushNotifications(config.src, config.metaData.name); + removePushNotifications(config.src, fileName); let _buildType; if (args.buildType === 'development' || args.buildType === 'debug') { _buildType = 'Debug'; @@ -203,10 +203,6 @@ async function xcodebuild(args, CODE_SIGN_IDENTITY_VAL, PROVISIONING_UUID, DEVEL const env = { RCT_NO_LAUNCH_PACKAGER: 1 }; - await exec('xcodebuild', ['-workspace', fileName + '.xcworkspace', '-scheme', fileName, '-configuration', _buildType, 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'DEVELOPMENT_TEAM=' + DEVELOPMENT_TEAM, 'CODE_SIGN_STYLE=Manual'], { - cwd: config.src + 'ios', - env: env - }); await exec('xcodebuild', ['-workspace', fileName + '.xcworkspace', '-scheme', fileName, '-configuration', _buildType, '-archivePath', 'build/' + fileName + '.xcarchive', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'archive', 'CODE_SIGN_STYLE=Manual'], { cwd: config.src + 'ios', env: env From 4bfa0e71a840a499ef6e8289c9253d0ed7afd817 Mon Sep 17 00:00:00 2001 From: bandhavya Date: Wed, 1 Sep 2021 15:05:28 +0530 Subject: [PATCH 22/49] Removed code that is unneccessary after expo upgrade to 42.x --- src/android.js | 13 ------------- src/command.js | 2 -- 2 files changed, 15 deletions(-) diff --git a/src/android.js b/src/android.js index f08c520..60cd087 100644 --- a/src/android.js +++ b/src/android.js @@ -143,18 +143,6 @@ function findFile(path, nameregex) { return endWith(path, '/') + f; } -async function updateToolsInBuildGradleFile() { - const path = config.src + 'android/build.gradle'; - let data = fs.readFileSync(path, 'utf8'); - console.log(data); - - let content = fs.readFileSync(path, 'utf8'); - // TODO update the version only when version is less than 4.0.1 and gradle-properties distributionUrl - 6.3.0 - content = content.replace(/com.android.tools.build:gradle:(\d+)\.(\d+)\.\d+/gm, 'com.android.tools.build:gradle:4.0.1'); - - await fs.writeFileSync(path, content); -} - async function updateAndroidBuildGradleFile(type) { const path = config.src + 'android/app/build.gradle'; let data = fs.readFileSync(path, 'utf8'); @@ -210,7 +198,6 @@ async function invokeAndroidBuild(args) { await generateSignedApk(keyStore, storePassword, keyAlias, keyPassword, args.packageType); } else { await updateAndroidBuildGradleFile(args.buildType); - await updateToolsInBuildGradleFile(); logger.info({ label: loggerLabel, message: 'Updated build.gradle file with debug configuration' diff --git a/src/command.js b/src/command.js index 66f85aa..8e33fb8 100644 --- a/src/command.js +++ b/src/command.js @@ -162,8 +162,6 @@ async function updateAppJsonFile(content, src) { if (config.platform === 'android') { result = await android.invokeAndroidBuild(args); } else if (config.platform === 'ios') { - updateExpoplistFile(); - await exec('pod', ['install'], { cwd: config.src + 'ios' }); From ad6dff56db7ba24283f3752456d2687c1a5a922c Mon Sep 17 00:00:00 2001 From: bandhavya Date: Wed, 1 Sep 2021 20:16:42 +0530 Subject: [PATCH 23/49] ios build was failing hence reverting the previous commit. --- src/command.js | 13 ------------- src/ios.js | 4 ++++ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/command.js b/src/command.js index 8e33fb8..e523aa9 100644 --- a/src/command.js +++ b/src/command.js @@ -28,19 +28,6 @@ function getFileSize(path) { return (stats && stats['size']) || 0; } -function updateExpoplistFile() { - const iosPath = config.src + 'ios'; - var filename = fs.readdirSync(iosPath).filter(v => { - return v.endsWith('.xcodeproj') || v.endsWith('.xcworkspace'); - }); - filename = filename[0].replace('.xcworkspace', '').replace('.xcodeproj', ''); - const plistPath = iosPath + '/' + filename + '/Supporting/Expo.plist'; - - var obj = plist.parse(fs.readFileSync(plistPath, 'utf8')); - obj['EXUpdatesURL'] = 'https://wavemaker.com'; // update with some dummy url - fs.writeFileSync(plistPath, plist.build(obj)) -} - async function updatePackageJsonFile(path) { return await new Promise(resolve => { try { diff --git a/src/ios.js b/src/ios.js index 30b85d1..3b29e1a 100644 --- a/src/ios.js +++ b/src/ios.js @@ -203,6 +203,10 @@ async function xcodebuild(args, CODE_SIGN_IDENTITY_VAL, PROVISIONING_UUID, DEVEL const env = { RCT_NO_LAUNCH_PACKAGER: 1 }; + await exec('xcodebuild', ['-workspace', fileName + '.xcworkspace', '-scheme', fileName, '-configuration', _buildType, 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'DEVELOPMENT_TEAM=' + DEVELOPMENT_TEAM, 'CODE_SIGN_STYLE=Manual'], { + cwd: config.src + 'ios', + env: env + }); await exec('xcodebuild', ['-workspace', fileName + '.xcworkspace', '-scheme', fileName, '-configuration', _buildType, '-archivePath', 'build/' + fileName + '.xcarchive', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'archive', 'CODE_SIGN_STYLE=Manual'], { cwd: config.src + 'ios', env: env From 019063fa58ec1c63d5c69f4d556db4ac16aa4aad Mon Sep 17 00:00:00 2001 From: Boyina Srinivasa Rao Date: Thu, 7 Oct 2021 19:47:03 +0530 Subject: [PATCH 24/49] ios build failed --- src/ios.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/ios.js b/src/ios.js index 49fe9f4..ce74dee 100644 --- a/src/ios.js +++ b/src/ios.js @@ -203,18 +203,28 @@ async function xcodebuild(args, CODE_SIGN_IDENTITY_VAL, PROVISIONING_UUID, DEVEL const env = { RCT_NO_LAUNCH_PACKAGER: 1 }; - await exec('xcodebuild', ['-workspace', fileName + '.xcworkspace', '-scheme', fileName, '-configuration', _buildType, 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'DEVELOPMENT_TEAM=' + DEVELOPMENT_TEAM, 'CODE_SIGN_STYLE=Manual'], { - cwd: config.src + 'ios', - env: env - }); - await exec('xcodebuild', ['-workspace', fileName + '.xcworkspace', '-scheme', fileName, '-configuration', _buildType, '-archivePath', 'build/' + fileName + '.xcarchive', 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, 'archive', 'CODE_SIGN_STYLE=Manual'], { + await exec('xcodebuild', [ + '-workspace', fileName + '.xcworkspace', + '-scheme', fileName, + '-configuration', _buildType, + '-destination', 'generic/platform=iOS', + '-archivePath', 'build/' + fileName + '.xcarchive', + 'CODE_SIGN_IDENTITY=' + CODE_SIGN_IDENTITY_VAL, + 'PROVISIONING_PROFILE=' + PROVISIONING_UUID, + 'CODE_SIGN_STYLE=Manual', + 'archive'], { cwd: config.src + 'ios', env: env }); const status = await updateInfoPlist(fileName, PROVISIONING_UUID); if (status === 'success') { - await exec('xcodebuild', ['-exportArchive', '-archivePath', 'build/' + fileName + '.xcarchive', '-exportOptionsPlist', 'build/' + fileName + '.xcarchive/Info.plist', '-exportPath', 'build'], { + await exec('xcodebuild', [ + '-exportArchive', + '-archivePath', 'build/' + fileName + '.xcarchive', + '-exportOptionsPlist', 'build/' + fileName + '.xcarchive/Info.plist', + '-exportPath', + 'build'], { cwd: config.src + 'ios', env: env }); From ffea349f16e62363df2b18df89a9f21948a6e2bd Mon Sep 17 00:00:00 2001 From: bandhavya Date: Wed, 24 Nov 2021 13:11:39 +0530 Subject: [PATCH 25/49] Adding hermes engine option through app.json --- src/android.js | 4 ---- src/command.js | 7 ++++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/android.js b/src/android.js index 60cd087..8b6e61c 100644 --- a/src/android.js +++ b/src/android.js @@ -98,10 +98,6 @@ async function generateAab(packageType) { function setDebugFlagInGradle(content) { let newContent; - // enableHermes option will always be there in the content, hence just set to true / false depending on preference value. - if (content.search(`enableHermes:`) !== -1 && config.metaData.preferences) { - content = content.replace(/enableHermes\: (true|false)/gm, `enableHermes: ${config.metaData.preferences.enableHermes}`); - } if (content.search(`entryFile: "index.js"`) === -1) { newContent = content.replace(/^(?!\s)project\.ext\.react = \[/gm, `project.ext.react = [ entryFile: "index.js", diff --git a/src/command.js b/src/command.js index e523aa9..009e7b9 100644 --- a/src/command.js +++ b/src/command.js @@ -71,6 +71,7 @@ async function updateAppJsonFile(content, src) { jsonData['expo']['android']['package'] = config.metaData.id; jsonData['expo']['ios']['bundleIdentifier'] = config.metaData.id; } + jsonData['expo']['jsEngine'] = config.metaData.preferences.enableHermes ? 'hermes' : 'jsc'; if (config.metaData.icon) { jsonData['expo']['icon'] = config.metaData.icon.src; jsonData['expo']['splash']['image'] = config.metaData.splash.src; @@ -149,9 +150,9 @@ async function updateAppJsonFile(content, src) { if (config.platform === 'android') { result = await android.invokeAndroidBuild(args); } else if (config.platform === 'ios') { - await exec('pod', ['install'], { - cwd: config.src + 'ios' - }); + // await exec('pod', ['install'], { + // cwd: config.src + 'ios' + // }); result = await invokeiosBuild(args); } if (result.errors && result.errors.length) { From 7cc8ee2f306c6ef232d1536028fbcb876b528703 Mon Sep 17 00:00:00 2001 From: bandhavya Date: Wed, 24 Nov 2021 13:29:14 +0530 Subject: [PATCH 26/49] removed commented code --- src/command.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/command.js b/src/command.js index 009e7b9..ac3eaf6 100644 --- a/src/command.js +++ b/src/command.js @@ -71,7 +71,7 @@ async function updateAppJsonFile(content, src) { jsonData['expo']['android']['package'] = config.metaData.id; jsonData['expo']['ios']['bundleIdentifier'] = config.metaData.id; } - jsonData['expo']['jsEngine'] = config.metaData.preferences.enableHermes ? 'hermes' : 'jsc'; + jsonData['expo']['jsEngine'] = config.metaData.preferences.enableHermes ? 'hermes' : 'jsc'; if (config.metaData.icon) { jsonData['expo']['icon'] = config.metaData.icon.src; jsonData['expo']['splash']['image'] = config.metaData.splash.src; @@ -150,9 +150,9 @@ async function updateAppJsonFile(content, src) { if (config.platform === 'android') { result = await android.invokeAndroidBuild(args); } else if (config.platform === 'ios') { - // await exec('pod', ['install'], { - // cwd: config.src + 'ios' - // }); + await exec('pod', ['install'], { + cwd: config.src + 'ios' + }); result = await invokeiosBuild(args); } if (result.errors && result.errors.length) { From 8a3203d15b07ecc838aa349b4490dc1a4e90e0cb Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Sat, 8 Jan 2022 12:42:32 +0530 Subject: [PATCH 27/49] Issue: production build failing --- src/android.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/android.js b/src/android.js index 8b6e61c..0dfa9cf 100644 --- a/src/android.js +++ b/src/android.js @@ -218,11 +218,11 @@ async function invokeAndroidBuild(args) { const outputFilePath = `${output}${appName}(${config.metaData.version}).${args.buildType}.${args.packageType === 'bundle' ? 'aab': 'apk'}`; let bundlePath = null; - let folder = args.buildType === 'production' ? 'release' : 'debug'; + let folder = args.buildType === 'release' ? 'release' : 'debug'; if (args.packageType === 'bundle') { - bundlePath = findFile(`${args.dest}/android/app/build/outputs/bundle/${folder}`, /\.aab?/); + bundlePath = findFile(`${args.dest}android/app/build/outputs/bundle/${folder}`, /\.aab?/); } else { - bundlePath = findFile(`${args.dest}/android/app/build/outputs/apk/${folder}`, /\.apk?/); + bundlePath = findFile(`${args.dest}android/app/build/outputs/apk/${folder}`, /\.apk?/); } fs.mkdirSync(output, {recursive: true}); fs.copyFileSync(bundlePath, outputFilePath); From 4dc8db759b8813b5c462f89a57040d46d32e8fed Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Mon, 17 Jan 2022 15:43:38 +0530 Subject: [PATCH 28/49] icon and splash are missing. --- src/command.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command.js b/src/command.js index ac3eaf6..d491705 100644 --- a/src/command.js +++ b/src/command.js @@ -114,10 +114,10 @@ async function updateAppJsonFile(content, src) { config.metaData = await readWmRNConfig(args.src); if (config.metaData.icon.src.startsWith('resources')) { - config.metaData.icon.src = 'src/' + config.metaData.icon.src; + config.metaData.icon.src = 'assets/' + config.metaData.icon.src; } if (config.metaData.splash.src.startsWith('resources')) { - config.metaData.splash.src = 'src/' + config.metaData.splash.src; + config.metaData.splash.src = 'assets/' + config.metaData.splash.src; } config.platform = args.platform; From 23b33e0ab5de5fdf3d6eac83b65e97c2bc248796 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Wed, 19 Jan 2022 19:50:02 +0530 Subject: [PATCH 29/49] added run expo command --- index.js | 9 +++ package-lock.json | 84 +++++++++++++-------- package.json | 1 + src/expo-launcher.js | 171 +++++++++++++++++++++++++++++++++++++++++++ src/requirements.js | 3 +- 5 files changed, 238 insertions(+), 30 deletions(-) create mode 100644 src/expo-launcher.js diff --git a/index.js b/index.js index ab30bd3..874235d 100755 --- a/index.js +++ b/index.js @@ -3,6 +3,9 @@ const { ejectProject, build } = require('./src/command'); +const { + runExpo +} = require('./src/expo-launcher'); // src is the web react native project zip const args = require('yargs') @@ -101,5 +104,11 @@ const args = require('yargs') type: 'boolean' }) }) + .command('run expo ', + 'launch local expo with a wavemaker project as source', + yargs => yargs, + (args) => { + runExpo(args.previewUrl) + }) .help('h') .alias('h', 'help').argv; diff --git a/package-lock.json b/package-lock.json index 83b55be..38a2741 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "axios": "^0.24.0", "execa": "^4.0.3", "fs-extra": "^9.0.1", "plist": "^3.0.2", @@ -79,6 +80,14 @@ "node": ">= 4.0.0" } }, + "node_modules/axios": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", + "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", + "dependencies": { + "follow-redirects": "^1.14.4" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -326,15 +335,34 @@ "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, + "node_modules/follow-redirects": { + "version": "1.14.7", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", + "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/fs-extra": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", - "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", - "universalify": "^1.0.0" + "universalify": "^2.0.0" }, "engines": { "node": ">=10" @@ -468,14 +496,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/jsonfile/node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/kuler": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", @@ -932,9 +952,9 @@ "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" }, "node_modules/universalify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", - "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", "engines": { "node": ">= 10.0.0" } @@ -1192,6 +1212,14 @@ "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" }, + "axios": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", + "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", + "requires": { + "follow-redirects": "^1.14.4" + } + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1392,15 +1420,20 @@ "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, + "follow-redirects": { + "version": "1.14.7", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", + "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==" + }, "fs-extra": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", - "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "requires": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", - "universalify": "^1.0.0" + "universalify": "^2.0.0" } }, "fs.realpath": { @@ -1500,13 +1533,6 @@ "requires": { "graceful-fs": "^4.1.6", "universalify": "^2.0.0" - }, - "dependencies": { - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" - } } }, "kuler": { @@ -1856,9 +1882,9 @@ "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" }, "universalify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", - "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" }, "util-deprecate": { "version": "1.0.2", diff --git a/package.json b/package.json index 8822719..f4f9ef1 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "author": "", "license": "ISC", "dependencies": { + "axios": "^0.24.0", "execa": "^4.0.3", "fs-extra": "^9.0.1", "plist": "^3.0.2", diff --git a/src/expo-launcher.js b/src/expo-launcher.js new file mode 100644 index 0000000..fab5467 --- /dev/null +++ b/src/expo-launcher.js @@ -0,0 +1,171 @@ +const logger = require('./logger'); +const fs = require('fs-extra'); +const rimraf = require("rimraf"); +const { + exec +} = require('./exec'); +const rootDir = `${require('os').homedir()}/.wm-reactnative-cli`; +const {VERSIONS, hasValidExpoVersion} = require('./requirements'); +const tempDir = rootDir + '/temp'; +const axios = require('axios'); +//const openTerminal = require('open-terminal').default; +const MAX_REQUEST_ALLOWED_TIME = 5 * 60 * 1000; +fs.mkdirSync(tempDir, {recursive: true}); +const loggerLabel = 'expo-launcher'; +function installGlobalNpmPackage(package) { + return exec('npm', ['install', '-g', package]); +} +let lastSyncTime = 0; +async function transpile(projectDir) { + let codegen = process.env.WAVEMAKER_STUDIO_FRONTEND_CODEBASE; + if (codegen) { + codegen = `${codegen}/wavemaker-rn-codegen/build/index.js`; + } else { + const wmProjectDir = getWmProjectDir(projectDir); + const temp = wmProjectDir + '/temp'; + fs.mkdirSync(temp, {recursive: true}); + await exec('npm', ['init', '-y'], { + cwd: wmProjectDir + '/temp' + }); + await exec('npm', ['install', '--save-dev', '@wavemaker/rn-codegen'], { + cwd: wmProjectDir + '/temp' + }); + codegen = `${wmProjectDir}/temp/node_modules/@wavemaker/rn-codegen/index.js`; + } + await exec('node', + [codegen, 'transpile', '--profile="expo-preview"', + getWmProjectDir(projectDir), getExpoProjectDir(projectDir)]); + logger.info({ + label: loggerLabel, + message: `generated expo project at ${getExpoProjectDir(projectDir)}` + }); +} + +async function installDependencies(projectDir) { + await exec('npm', ['install'], { + cwd: getExpoProjectDir(projectDir) + }); +} + +async function launchExpo(projectDir) { + //openTerminal(`cd ${getExpoProjectDir(projectDir)}; expo start --web`); + await exec('expo', ['start'], { + cwd: getExpoProjectDir(projectDir) + }); +} + +async function downloadProject(previewUrl) { + const tempFile = `${tempDir}/changes_${Date.now()}.zip`; + const res = await axios.get(`${previewUrl}/services/project/exportChanges?after=${lastSyncTime}`, { + timeout: MAX_REQUEST_ALLOWED_TIME, + responseType: 'stream' + }).catch(error => error.response); + lastSyncTime = (res.headers && res.headers['x-wm-exported-at']) || lastSyncTime; + if (res.status === 304) { + return ''; + } + if (res.status !== 200) { + throw new Error('failed to download the zip'); + } + await new Promise((resolve, reject) => { + const fw = fs.createWriteStream(tempFile); + res.data.pipe(fw); + fw.on('error', err => { + reject(err); + fw.close(); + }); + fw.on('close', resolve); + }); + logger.info({ + label: loggerLabel, + message: 'downloaded the base zip.' + }); + return tempFile; +} + +function clean(path) { + if (fs.existsSync(path)) { + rimraf.sync(path); + } + fs.mkdirSync(path, {recursive: true}); +} + +function getWmProjectDir(projectDir) { + return `${projectDir}/wm-project`; +} + +function getExpoProjectDir(projectDir) { + return `${projectDir}/expo-project`; +} + +async function setup(zipFile, previewUrl, _clean) { + const tempProjectDir = `${tempDir}/${Date.now()}`; + await exec('unzip', ['-o', zipFile, '-d', tempProjectDir], { + log: false + }); + const configJSONFile = `${tempProjectDir}/wm_rn_config.json`; + const config = require(configJSONFile); + if (config.serverPath === '{{DEVELOPMENT_URL}}') { + config.serverPath = previewUrl; + fs.writeFileSync(configJSONFile, JSON.stringify(config, null, 4)); + } + const projectDir = `${rootDir}/build/${config.id}`; + const wmProjectDir = getWmProjectDir(projectDir); + const expoProjectDir = getExpoProjectDir(projectDir); + if (_clean) { + clean(wmProjectDir); + clean(expoProjectDir); + } + fs.copySync(tempProjectDir, wmProjectDir); + rimraf.sync(tempProjectDir); + rimraf.sync(zipFile); + return projectDir; +} + +async function syncLocalWMProject(previewUrl, clean) { + const zipFile = await downloadProject(previewUrl); + if (zipFile) { + const projectDir = await setup(zipFile, previewUrl, clean); + await transpile(projectDir); + return projectDir; + } +} + +async function checkForChanges(previewUrl) { + try { + await syncLocalWMProject(previewUrl); + } catch(e) { + logger.debug({ + label: loggerLabel, + message: e + }); + } + const current = Date.now(); + setTimeout(() => checkForChanges(previewUrl, current), 5000); +} + +async function runExpo(previewUrl) { + try { + const hasExpo = await hasValidExpoVersion(); + if (!hasExpo) { + logger.debug({ + label: loggerLabel, + message: 'Installing expo-cli@' + VERSIONS.EXPO + }); + await installGlobalNpmPackage('expo-cli@' + VERSIONS.EXPO); + } + const projectDir = await syncLocalWMProject(previewUrl, true); + await installDependencies(projectDir); + launchExpo(projectDir); + checkForChanges(previewUrl); + } catch(e) { + logger.error({ + label: loggerLabel, + message: e + }); + } +} + +module.exports = { + runExpo: runExpo +}; \ No newline at end of file diff --git a/src/requirements.js b/src/requirements.js index 903ad49..239b10b 100644 --- a/src/requirements.js +++ b/src/requirements.js @@ -210,6 +210,7 @@ module.exports = { showConfirmation: showConfirmation, checkForAndroidStudioAvailability: checkForAndroidStudioAvailability, checkForGradleAvailability: checkForGradleAvailability, - hasValidExpoVersion: hasValidExpoVersion + hasValidExpoVersion: hasValidExpoVersion, + VERSIONS: VERSIONS } // TODO: support for multiple react native versions. From a80556bb953f4441775475c3ad12b9c5b1b19b7c Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Wed, 19 Jan 2022 20:03:05 +0530 Subject: [PATCH 30/49] added missing dependency --- package-lock.json | 1 + package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/package-lock.json b/package-lock.json index 38a2741..e7c5e2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "fs-extra": "^9.0.1", "plist": "^3.0.2", "prompt": "^1.0.0", + "rimraf": "^2.7.1", "semver": "^7.3.2", "winston": "^3.3.3", "yargs": "^15.4.0", diff --git a/package.json b/package.json index f4f9ef1..c928d44 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "fs-extra": "^9.0.1", "plist": "^3.0.2", "prompt": "^1.0.0", + "rimraf": "^2.7.1", "semver": "^7.3.2", "winston": "^3.3.3", "yargs": "^15.4.0", From e447b078167de7afd67cf4fac22316b5c8765247 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Sun, 30 Jan 2022 18:48:17 +0530 Subject: [PATCH 31/49] added proxy option to service --- index.js | 10 +++++-- package-lock.json | 44 +++++++++++++++++++++++++++++++ package.json | 1 + src/expo-launcher.js | 63 +++++++++++++++++++++++++++++++++++++------- 4 files changed, 106 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index 874235d..3661d75 100755 --- a/index.js +++ b/index.js @@ -106,9 +106,15 @@ const args = require('yargs') }) .command('run expo ', 'launch local expo with a wavemaker project as source', - yargs => yargs, + yargs => { + yargs.option('useServiceProxy', { + describe: 'If set to true then a proxy will be started on 19009 port.', + default: false, + type: 'boolean' + }); + }, (args) => { - runExpo(args.previewUrl) + runExpo(args.previewUrl, args.useServiceProxy) }) .help('h') .alias('h', 'help').argv; diff --git a/package-lock.json b/package-lock.json index e7c5e2b..b276296 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "axios": "^0.24.0", "execa": "^4.0.3", "fs-extra": "^9.0.1", + "http-proxy": "^1.18.1", "plist": "^3.0.2", "prompt": "^1.0.0", "rimraf": "^2.7.1", @@ -279,6 +280,11 @@ "once": "^1.4.0" } }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, "node_modules/execa": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.3.tgz", @@ -420,6 +426,19 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, + "node_modules/http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "dependencies": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -805,6 +824,11 @@ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, "node_modules/revalidator": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz", @@ -1376,6 +1400,11 @@ "once": "^1.4.0" } }, + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, "execa": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.3.tgz", @@ -1473,6 +1502,16 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, + "http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "requires": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -1779,6 +1818,11 @@ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, "revalidator": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz", diff --git a/package.json b/package.json index c928d44..f398898 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "axios": "^0.24.0", "execa": "^4.0.3", "fs-extra": "^9.0.1", + "http-proxy": "^1.18.1", "plist": "^3.0.2", "prompt": "^1.0.0", "rimraf": "^2.7.1", diff --git a/src/expo-launcher.js b/src/expo-launcher.js index fab5467..7ae1457 100644 --- a/src/expo-launcher.js +++ b/src/expo-launcher.js @@ -1,6 +1,8 @@ const logger = require('./logger'); const fs = require('fs-extra'); +const os = require('os'); const rimraf = require("rimraf"); +const httpProxy = require('http-proxy'); const { exec } = require('./exec'); @@ -10,12 +12,48 @@ const tempDir = rootDir + '/temp'; const axios = require('axios'); //const openTerminal = require('open-terminal').default; const MAX_REQUEST_ALLOWED_TIME = 5 * 60 * 1000; +const proxyPort = 19009; fs.mkdirSync(tempDir, {recursive: true}); const loggerLabel = 'expo-launcher'; function installGlobalNpmPackage(package) { return exec('npm', ['install', '-g', package]); } let lastSyncTime = 0; + +function launchServiceProxy(previewUrl) { + httpProxy.createProxyServer({ + target: previewUrl, + changeOrigin: true + }).on('proxyRes', function (proxyRes, req, res) { + const cookies = proxyRes.headers['set-cookie']; + if (cookies) { + proxyRes.headers['set-cookie'] = cookies.map(c => { + return c.split(';').map(s => s.trim()).filter(cs => { + return !(cs.startsWith('Path') || cs.startsWith('Secure') || cs.startsWith('HttpOnly')); + }).join('; '); + });; + } + }).listen(proxyPort); + logger.info({ + label: loggerLabel, + message: `Service proxy launched on ${proxyPort} .` + }); +} + +function getIpAddress() { + var interfaces = os.networkInterfaces(); + for(var key in interfaces) { + var addresses = interfaces[key]; + for(var i = 0; i < addresses.length; i++) { + var address = addresses[i]; + if(!address.internal && address.family === 'IPv4') { + return address.address; + }; + }; + }; + return 'localhost'; +} + async function transpile(projectDir) { let codegen = process.env.WAVEMAKER_STUDIO_FRONTEND_CODEBASE; if (codegen) { @@ -98,17 +136,19 @@ function getExpoProjectDir(projectDir) { return `${projectDir}/expo-project`; } -async function setup(zipFile, previewUrl, _clean) { +async function setup(zipFile, previewUrl, useServiceProxy, _clean) { const tempProjectDir = `${tempDir}/${Date.now()}`; await exec('unzip', ['-o', zipFile, '-d', tempProjectDir], { log: false }); const configJSONFile = `${tempProjectDir}/wm_rn_config.json`; const config = require(configJSONFile); - if (config.serverPath === '{{DEVELOPMENT_URL}}') { + if (useServiceProxy) { + config.serverPath = `http://${getIpAddress()}:${proxyPort}`; + } else if (config.serverPath === '{{DEVELOPMENT_URL}}') { config.serverPath = previewUrl; - fs.writeFileSync(configJSONFile, JSON.stringify(config, null, 4)); } + fs.writeFileSync(configJSONFile, JSON.stringify(config, null, 4)); const projectDir = `${rootDir}/build/${config.id}`; const wmProjectDir = getWmProjectDir(projectDir); const expoProjectDir = getExpoProjectDir(projectDir); @@ -122,18 +162,18 @@ async function setup(zipFile, previewUrl, _clean) { return projectDir; } -async function syncLocalWMProject(previewUrl, clean) { +async function syncLocalWMProject(previewUrl, useServiceProxy, clean) { const zipFile = await downloadProject(previewUrl); if (zipFile) { - const projectDir = await setup(zipFile, previewUrl, clean); + const projectDir = await setup(zipFile, previewUrl, useServiceProxy, clean); await transpile(projectDir); return projectDir; } } -async function checkForChanges(previewUrl) { +async function checkForChanges(previewUrl, useServiceProxy) { try { - await syncLocalWMProject(previewUrl); + await syncLocalWMProject(previewUrl, useServiceProxy); } catch(e) { logger.debug({ label: loggerLabel, @@ -144,7 +184,7 @@ async function checkForChanges(previewUrl) { setTimeout(() => checkForChanges(previewUrl, current), 5000); } -async function runExpo(previewUrl) { +async function runExpo(previewUrl, useServiceProxy) { try { const hasExpo = await hasValidExpoVersion(); if (!hasExpo) { @@ -154,10 +194,13 @@ async function runExpo(previewUrl) { }); await installGlobalNpmPackage('expo-cli@' + VERSIONS.EXPO); } - const projectDir = await syncLocalWMProject(previewUrl, true); + const projectDir = await syncLocalWMProject(previewUrl, useServiceProxy, true); await installDependencies(projectDir); + if (useServiceProxy) { + launchServiceProxy(previewUrl); + } launchExpo(projectDir); - checkForChanges(previewUrl); + checkForChanges(previewUrl, useServiceProxy); } catch(e) { logger.error({ label: loggerLabel, From fac0bd0a761bc59e6b9f723312fa4cc94c21cce6 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Sun, 30 Jan 2022 22:53:22 +0530 Subject: [PATCH 32/49] added web and clean options to expo command --- index.js | 11 ++++++++--- src/expo-launcher.js | 11 ++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 3661d75..589b019 100755 --- a/index.js +++ b/index.js @@ -107,14 +107,19 @@ const args = require('yargs') .command('run expo ', 'launch local expo with a wavemaker project as source', yargs => { - yargs.option('useServiceProxy', { - describe: 'If set to true then a proxy will be started on 19009 port.', + yargs.option('web', { + describe: 'If set to true then web will be started.', + default: false, + type: 'boolean' + }); + yargs.option('clean', { + describe: 'If set to true then all existing folders are removed.', default: false, type: 'boolean' }); }, (args) => { - runExpo(args.previewUrl, args.useServiceProxy) + runExpo(args.previewUrl, args.web, args.clean) }) .help('h') .alias('h', 'help').argv; diff --git a/src/expo-launcher.js b/src/expo-launcher.js index 7ae1457..3a4d1d2 100644 --- a/src/expo-launcher.js +++ b/src/expo-launcher.js @@ -85,9 +85,9 @@ async function installDependencies(projectDir) { }); } -async function launchExpo(projectDir) { +async function launchExpo(projectDir, web) { //openTerminal(`cd ${getExpoProjectDir(projectDir)}; expo start --web`); - await exec('expo', ['start'], { + await exec('expo', ['start', web ? '--web': null], { cwd: getExpoProjectDir(projectDir) }); } @@ -184,7 +184,8 @@ async function checkForChanges(previewUrl, useServiceProxy) { setTimeout(() => checkForChanges(previewUrl, current), 5000); } -async function runExpo(previewUrl, useServiceProxy) { +async function runExpo(previewUrl, web, clean) { + const useServiceProxy = !!web; try { const hasExpo = await hasValidExpoVersion(); if (!hasExpo) { @@ -194,12 +195,12 @@ async function runExpo(previewUrl, useServiceProxy) { }); await installGlobalNpmPackage('expo-cli@' + VERSIONS.EXPO); } - const projectDir = await syncLocalWMProject(previewUrl, useServiceProxy, true); + const projectDir = await syncLocalWMProject(previewUrl, useServiceProxy, clean); await installDependencies(projectDir); if (useServiceProxy) { launchServiceProxy(previewUrl); } - launchExpo(projectDir); + launchExpo(projectDir, web); checkForChanges(previewUrl, useServiceProxy); } catch(e) { logger.error({ From 9cd42c8a7f6af811082ae1f4d1cab538110961f1 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Mon, 31 Jan 2022 14:19:36 +0530 Subject: [PATCH 33/49] Allow CORS in proxy. --- README.md | 11 +++++++++++ src/expo-launcher.js | 13 ++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 034a627..b0656e1 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,17 @@ wm-reactnative build ios "/path/to/src" \ ~~~ +## Run Expo locally + +### Requirements + +|                   **Argument**                     | **Description** | +|--|--| +| **preview_url** | app preview url | +|**\-\-clean**|**DEFAULT:** false
if true, existing project directory is removed | +|**\-\-web**|**OPTIONAL:** false
if true, app is automatically launched in browser | + + ## Additional Information 1. Destination folder path is logged at the start of the build. diff --git a/src/expo-launcher.js b/src/expo-launcher.js index 3a4d1d2..15fae8e 100644 --- a/src/expo-launcher.js +++ b/src/expo-launcher.js @@ -33,6 +33,13 @@ function launchServiceProxy(previewUrl) { }).join('; '); });; } + if (req.method === 'OPTIONS') { + proxyRes.headers['Access-Control-Allow-Origin'] = `http://${getIpAddress()}:19006`; + proxyRes.headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, DELETE, OPTIONS'; + proxyRes.headers['Access-Control-Allow-Headers'] = 'x-wm-xsrf-token'; + proxyRes.headers['Access-Control-Allow-Credentials'] = true; + proxyRes.headers['Access-Control-Max-Age'] = 1600; + } }).listen(proxyPort); logger.info({ label: loggerLabel, @@ -87,7 +94,11 @@ async function installDependencies(projectDir) { async function launchExpo(projectDir, web) { //openTerminal(`cd ${getExpoProjectDir(projectDir)}; expo start --web`); - await exec('expo', ['start', web ? '--web': null], { + const args = ['start']; + if (web) { + args.push('--web'); + } + await exec('expo', args, { cwd: getExpoProjectDir(projectDir) }); } From b011425df9c41c6311bcfdccc335ebf4a504e7ca Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Mon, 31 Jan 2022 14:23:32 +0530 Subject: [PATCH 34/49] documentation --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index b0656e1..7fec6ff 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,12 @@ wm-reactnative build ios "/path/to/src" \ ## Run Expo locally ### Requirements +- Node 12.x +- npm 7.20.x + +### Command + +wm-reactnative run expo [additional_arguments] |                   **Argument**                     | **Description** | |--|--| From 0bf9ae1cac0905bbf1889f117b413e0f5d97d458 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Mon, 31 Jan 2022 14:43:39 +0530 Subject: [PATCH 35/49] Fix: chages are not getting synced --- src/expo-launcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expo-launcher.js b/src/expo-launcher.js index 15fae8e..81b7525 100644 --- a/src/expo-launcher.js +++ b/src/expo-launcher.js @@ -192,7 +192,7 @@ async function checkForChanges(previewUrl, useServiceProxy) { }); } const current = Date.now(); - setTimeout(() => checkForChanges(previewUrl, current), 5000); + setTimeout(() => checkForChanges(previewUrl, useServiceProxy, current), 5000); } async function runExpo(previewUrl, web, clean) { From 0fbf30feee21840140796af7e888c05278639c2f Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Mon, 31 Jan 2022 20:32:45 +0530 Subject: [PATCH 36/49] proxy fails with cors error --- src/expo-launcher.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/expo-launcher.js b/src/expo-launcher.js index 81b7525..d0c5c7e 100644 --- a/src/expo-launcher.js +++ b/src/expo-launcher.js @@ -21,6 +21,7 @@ function installGlobalNpmPackage(package) { let lastSyncTime = 0; function launchServiceProxy(previewUrl) { + const ip = getIpAddress(); httpProxy.createProxyServer({ target: previewUrl, changeOrigin: true @@ -34,11 +35,11 @@ function launchServiceProxy(previewUrl) { });; } if (req.method === 'OPTIONS') { - proxyRes.headers['Access-Control-Allow-Origin'] = `http://${getIpAddress()}:19006`; - proxyRes.headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, DELETE, OPTIONS'; - proxyRes.headers['Access-Control-Allow-Headers'] = 'x-wm-xsrf-token'; - proxyRes.headers['Access-Control-Allow-Credentials'] = true; - proxyRes.headers['Access-Control-Max-Age'] = 1600; + proxyRes.headers['access-control-allow-origin'] = `http://${ip}:19006`; + proxyRes.headers['access-control-allow-methods'] = proxyRes.headers['access-control-allow-methods'] || 'GET, PUT, POST, DELETE, OPTIONS'; + proxyRes.headers['access-control-allow-headers'] = proxyRes.headers['access-control-allow-headers'] || 'x-wm-xsrf-token'; + proxyRes.headers['access-control-allow-credentials'] = true; + proxyRes.headers['access-control-max-age'] = 1600; } }).listen(proxyPort); logger.info({ From 01b1c12f14a58edec7a7a48a526c1ca542e28b2b Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Mon, 7 Feb 2022 21:13:17 +0530 Subject: [PATCH 37/49] Fix: hermes preference is not set --- src/android.js | 12 ++++++++++++ src/ios.js | 13 ++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/android.js b/src/android.js index 0dfa9cf..53a2b43 100644 --- a/src/android.js +++ b/src/android.js @@ -62,6 +62,17 @@ function updateSigningConfig(content) { return content; } +function updateJSEnginePreference() { + const jsEngine = require(config.src + 'app.json').expo.jsEngine; + const gradlePropsPath = config.src + 'android/gradle.properties'; + if (fs.existsSync(gradlePropsPath)) { + let data = fs.readFileSync(gradlePropsPath, 'utf8'); + data = data.replace(/expo\.jsEngine=(jsc|hermes)/, `expo.jsEngine=${jsEngine}`) + fs.writeFileSync(gradlePropsPath, data); + console.log(`js engine is set as ${jsEngine}`); + } +} + function setSigningConfigInGradle() { const gradlePath = config.src + 'android/app/build.gradle'; @@ -179,6 +190,7 @@ async function invokeAndroidBuild(args) { } } + updateJSEnginePreference(); const appName = config.metaData.name; await updateSettingsGradleFile(appName); diff --git a/src/ios.js b/src/ios.js index b2ea36e..52fff5f 100644 --- a/src/ios.js +++ b/src/ios.js @@ -75,6 +75,17 @@ async function getUsername() { return content[0]; } +function updateJSEnginePreference() { + const jsEngine = require(config.src + 'app.json').expo.jsEngine; + const podJSON = config.src + 'ios/Podfile.properties.json'; + if (fs.existsSync(podJSON)) { + let data = require(podJSON, 'utf8'); + data['expo.jsEngine'] = jsEngine; + fs.writeFileSync(podJSON, JSON.stringify(data, null, 4)); + console.log(`js engine is set as ${jsEngine}`); + } +} + async function invokeiosBuild(args) { const certificate = args.iCertificate; const certificatePassword = args.iCertificatePassword; @@ -92,11 +103,11 @@ async function invokeiosBuild(args) { errors: errors } } + updateJSEnginePreference(); const random = Date.now(); const username = await getUsername(); const keychainName = `wm-reactnative-${random}.keychain`; const provisionuuid = await extractUUID(provisionalFile); - let codeSignIdentity = await exec(`openssl pkcs12 -in ${certificate} -passin pass:${certificatePassword} -nodes | openssl x509 -noout -subject -nameopt multiline | grep commonName | sed -n 's/ *commonName *= //p'`, null, { shell: true }); From a8ea673384cc2e21070835859b630044ada3a605 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Mon, 7 Feb 2022 21:16:30 +0530 Subject: [PATCH 38/49] build failing due to missing provisioning profile --- src/ios.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ios.js b/src/ios.js index 52fff5f..d5c40cd 100644 --- a/src/ios.js +++ b/src/ios.js @@ -126,6 +126,12 @@ async function invokeiosBuild(args) { fs.mkdirSync(ppFolder, { recursive: true }) + const targetProvisionsalPath = `${ppFolder}/${provisionuuid}.mobileprovision`; + fs.copyFileSync(provisionalFile, targetProvisionsalPath); + logger.info({ + label: loggerLabel, + message: `copied provisionalFile (${provisionalFile}).` + }); const removeKeyChain = await importCertToKeyChain(keychainName, certificate, certificatePassword); try { From 890e9979fb50d3b672ad1690f145af50b748e9b9 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Mon, 7 Feb 2022 21:35:43 +0530 Subject: [PATCH 39/49] added log messages --- src/android.js | 5 ++++- src/ios.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/android.js b/src/android.js index 53a2b43..73eb5dd 100644 --- a/src/android.js +++ b/src/android.js @@ -69,7 +69,10 @@ function updateJSEnginePreference() { let data = fs.readFileSync(gradlePropsPath, 'utf8'); data = data.replace(/expo\.jsEngine=(jsc|hermes)/, `expo.jsEngine=${jsEngine}`) fs.writeFileSync(gradlePropsPath, data); - console.log(`js engine is set as ${jsEngine}`); + logger.info({ + label: loggerLabel, + message: `js engine is set as ${jsEngine}` + }); } } diff --git a/src/ios.js b/src/ios.js index d5c40cd..0cba979 100644 --- a/src/ios.js +++ b/src/ios.js @@ -82,7 +82,10 @@ function updateJSEnginePreference() { let data = require(podJSON, 'utf8'); data['expo.jsEngine'] = jsEngine; fs.writeFileSync(podJSON, JSON.stringify(data, null, 4)); - console.log(`js engine is set as ${jsEngine}`); + logger.info({ + label: loggerLabel, + message: `js engine is set as ${jsEngine}` + }); } } From 30857b525a47a96577cfc12bd22323552487daae Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Fri, 18 Feb 2022 00:50:47 +0530 Subject: [PATCH 40/49] changed the url to retrieve source --- src/expo-launcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expo-launcher.js b/src/expo-launcher.js index d0c5c7e..fe26297 100644 --- a/src/expo-launcher.js +++ b/src/expo-launcher.js @@ -106,7 +106,7 @@ async function launchExpo(projectDir, web) { async function downloadProject(previewUrl) { const tempFile = `${tempDir}/changes_${Date.now()}.zip`; - const res = await axios.get(`${previewUrl}/services/project/exportChanges?after=${lastSyncTime}`, { + const res = await axios.get(`${previewUrl}/resources/ui-source.zip?after=${lastSyncTime}`, { timeout: MAX_REQUEST_ALLOWED_TIME, responseType: 'stream' }).catch(error => error.response); From af6adae78386157ce8814676ae0da5013f3bc9f0 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Thu, 17 Mar 2022 10:52:11 +0530 Subject: [PATCH 41/49] enforce user authentication to perform project sync. --- index.js | 12 + package-lock.json | 1380 +++++++++++++++++++++++++++++++++++ package.json | 3 + src/expo-launcher.js | 117 ++- src/project-sync.service.js | 177 +++++ 5 files changed, 1615 insertions(+), 74 deletions(-) create mode 100644 src/project-sync.service.js diff --git a/index.js b/index.js index 589b019..690f4b3 100755 --- a/index.js +++ b/index.js @@ -3,10 +3,22 @@ const { ejectProject, build } = require('./src/command'); +const os = require('os'); +const { LocalStorage } = require('node-localstorage'); const { runExpo } = require('./src/expo-launcher'); +const updateNotifier = require('update-notifier'); +const pkg = require('./package.json'); +updateNotifier({ + pkg: pkg, + updateCheckInterval : 60 * 60 * 1000 +}).notify({ + defer: false +}); +global.rootDir = `${os.homedir()}/.wm-reactnative-cli`; +global.localStorage = new LocalStorage(`${global.rootDir}/.store`); // src is the web react native project zip const args = require('yargs') .command('build', 'build the project to generate android and ios folders', yargs => { diff --git a/package-lock.json b/package-lock.json index b276296..4b67e46 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,10 +13,13 @@ "execa": "^4.0.3", "fs-extra": "^9.0.1", "http-proxy": "^1.18.1", + "node-localstorage": "^2.2.1", "plist": "^3.0.2", "prompt": "^1.0.0", + "qs": "^6.10.3", "rimraf": "^2.7.1", "semver": "^7.3.2", + "update-notifier": "^5.1.0", "winston": "^3.3.3", "yargs": "^15.4.0", "yarn": "^1.22.10" @@ -47,6 +50,33 @@ "kuler": "^2.0.0" } }, + "node_modules/@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dependencies": { + "defer-to-connect": "^1.0.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-align": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", + "dependencies": { + "string-width": "^4.1.0" + } + }, "node_modules/ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", @@ -114,6 +144,54 @@ } ] }, + "node_modules/boxen": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", + "dependencies": { + "ansi-align": "^3.0.0", + "camelcase": "^6.2.0", + "chalk": "^4.1.0", + "cli-boxes": "^2.2.1", + "string-width": "^4.2.2", + "type-fest": "^0.20.2", + "widest-line": "^3.1.0", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/boxen/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/boxen/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -123,6 +201,43 @@ "concat-map": "0.0.1" } }, + "node_modules/cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cacheable-request/node_modules/lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -131,6 +246,37 @@ "node": ">=6" } }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" + }, + "node_modules/cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -141,6 +287,14 @@ "wrap-ansi": "^6.2.0" } }, + "node_modules/clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dependencies": { + "mimic-response": "^1.0.0" + } + }, "node_modules/color": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz", @@ -210,6 +364,33 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "node_modules/configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "dependencies": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/configstore/node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, "node_modules/core-js-pure": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.14.0.tgz", @@ -238,6 +419,14 @@ "node": ">= 8" } }, + "node_modules/crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "engines": { + "node": ">=8" + } + }, "node_modules/cycle": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", @@ -257,11 +446,51 @@ "node": ">=6" } }, + "node_modules/decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dependencies": { + "mimic-response": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/deep-equal": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz", "integrity": "sha1-hLdFiW80xoTpjyzg5Cq69Du6AX0=" }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==" + }, + "node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -280,6 +509,14 @@ "once": "^1.4.0" } }, + "node_modules/escape-goat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", + "engines": { + "node": ">=8" + } + }, "node_modules/eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -380,6 +617,11 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -388,6 +630,19 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", @@ -421,11 +676,100 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/global-dirs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", + "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", + "dependencies": { + "ini": "2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dependencies": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/got/node_modules/get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/graceful-fs": { "version": "4.2.6", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" + }, "node_modules/http-proxy": { "version": "1.18.1", "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", @@ -455,6 +799,22 @@ "node": ">=0.4" } }, + "node_modules/import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "engines": { + "node": ">=4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "engines": { + "node": ">=0.8.19" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -469,11 +829,30 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "engines": { + "node": ">=10" + } + }, "node_modules/is-arrayish": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, + "node_modules/is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dependencies": { + "ci-info": "^2.0.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -482,6 +861,48 @@ "node": ">=8" } }, + "node_modules/is-installed-globally": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "dependencies": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-npm": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", + "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "engines": { + "node": ">=8" + } + }, "node_modules/is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", @@ -490,6 +911,16 @@ "node": ">=8" } }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "node_modules/is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==" + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -505,6 +936,11 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "node_modules/json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" + }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -516,11 +952,30 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dependencies": { + "json-buffer": "3.0.0" + } + }, "node_modules/kuler": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" }, + "node_modules/latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "dependencies": { + "package-json": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -544,6 +999,14 @@ "triple-beam": "^1.3.0" } }, + "node_modules/lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -555,6 +1018,28 @@ "node": ">=10" } }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -568,6 +1053,14 @@ "node": ">=6" } }, + "node_modules/mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "engines": { + "node": ">=4" + } + }, "node_modules/minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -613,6 +1106,25 @@ "ncp": "bin/ncp" } }, + "node_modules/node-localstorage": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-2.2.1.tgz", + "integrity": "sha512-vv8fJuOUCCvSPjDjBLlMqYMHob4aGjkmrkaE42/mZr0VT+ZAU10jRF8oTnX9+pgU9/vYJ8P7YT3Vd6ajkmzSCw==", + "dependencies": { + "write-file-atomic": "^1.1.4" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/normalize-url": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", + "engines": { + "node": ">=8" + } + }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -624,6 +1136,14 @@ "node": ">=8" } }, + "node_modules/object-inspect": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -654,6 +1174,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "engines": { + "node": ">=6" + } + }, "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -687,6 +1215,28 @@ "node": ">=6" } }, + "node_modules/package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dependencies": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/package-json/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -724,6 +1274,14 @@ "node": ">=6" } }, + "node_modules/prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "engines": { + "node": ">=4" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -782,6 +1340,50 @@ "once": "^1.3.1" } }, + "node_modules/pupa": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", + "dependencies": { + "escape-goat": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qs": { + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", + "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, "node_modules/read": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", @@ -811,6 +1413,28 @@ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" }, + "node_modules/registry-auth-token": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "dependencies": { + "rc": "^1.2.8" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dependencies": { + "rc": "^1.2.8" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -829,6 +1453,14 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" }, + "node_modules/responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dependencies": { + "lowercase-keys": "^1.0.0" + } + }, "node_modules/revalidator": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz", @@ -881,6 +1513,25 @@ "node": ">=10" } }, + "node_modules/semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "dependencies": { + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/semver-diff/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -905,6 +1556,19 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", @@ -918,6 +1582,14 @@ "is-arrayish": "^0.3.1" } }, + "node_modules/slide": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "engines": { + "node": "*" + } + }, "node_modules/stack-trace": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", @@ -966,16 +1638,73 @@ "node": ">=6" } }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/text-hex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" }, + "node_modules/to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "engines": { + "node": ">=6" + } + }, "node_modules/triple-beam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dependencies": { + "crypto-random-string": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", @@ -984,6 +1713,44 @@ "node": ">= 10.0.0" } }, + "node_modules/update-notifier": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", + "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", + "dependencies": { + "boxen": "^5.0.0", + "chalk": "^4.1.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.4.0", + "is-npm": "^5.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.1.0", + "pupa": "^2.1.1", + "semver": "^7.3.4", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/yeoman/update-notifier?sponsor=1" + } + }, + "node_modules/url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dependencies": { + "prepend-http": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -1029,6 +1796,17 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, + "node_modules/widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dependencies": { + "string-width": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/winston": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz", @@ -1105,6 +1883,24 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, + "node_modules/write-file-atomic": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + }, + "node_modules/xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "engines": { + "node": ">=8" + } + }, "node_modules/xmlbuilder": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", @@ -1214,6 +2010,27 @@ "kuler": "^2.0.0" } }, + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==" + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "requires": { + "defer-to-connect": "^1.0.1" + } + }, + "ansi-align": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", + "requires": { + "string-width": "^4.1.0" + } + }, "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", @@ -1255,6 +2072,38 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, + "boxen": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", + "requires": { + "ansi-align": "^3.0.0", + "camelcase": "^6.2.0", + "chalk": "^4.1.0", + "cli-boxes": "^2.2.1", + "string-width": "^4.2.2", + "type-fest": "^0.20.2", + "widest-line": "^3.1.0", + "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==" + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + } + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1264,11 +2113,60 @@ "concat-map": "0.0.1" } }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==" + } + } + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/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": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" + }, + "cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==" + }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -1279,6 +2177,14 @@ "wrap-ansi": "^6.2.0" } }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "requires": { + "mimic-response": "^1.0.0" + } + }, "color": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz", @@ -1344,6 +2250,32 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "requires": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + }, + "dependencies": { + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + } + } + }, "core-js-pure": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.14.0.tgz", @@ -1364,6 +2296,11 @@ "which": "^2.0.1" } }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==" + }, "cycle": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", @@ -1377,11 +2314,42 @@ "xregexp": "^4.2.4" } }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "requires": { + "mimic-response": "^1.0.0" + } + }, "deep-equal": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz", "integrity": "sha1-hLdFiW80xoTpjyzg5Cq69Du6AX0=" }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + }, + "defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==" + }, + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "requires": { + "is-obj": "^2.0.0" + } + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -1400,6 +2368,11 @@ "once": "^1.4.0" } }, + "escape-goat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==" + }, "eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -1471,11 +2444,26 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/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": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", @@ -1497,11 +2485,75 @@ "path-is-absolute": "^1.0.0" } }, + "global-dirs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", + "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", + "requires": { + "ini": "2.0.0" + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + }, + "dependencies": { + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + } + } + } + }, "graceful-fs": { "version": "4.2.6", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==" + }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" + }, "http-proxy": { "version": "1.18.1", "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", @@ -1522,6 +2574,16 @@ "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=" }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=" + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1536,21 +2598,68 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==" + }, "is-arrayish": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "requires": { + "ci-info": "^2.0.0" + } + }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, + "is-installed-globally": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "requires": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + } + }, + "is-npm": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", + "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==" + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" + }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" + }, "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==" + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1566,6 +2675,11 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" + }, "jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -1575,11 +2689,27 @@ "universalify": "^2.0.0" } }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "requires": { + "json-buffer": "3.0.0" + } + }, "kuler": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" }, + "latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "requires": { + "package-json": "^6.3.0" + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -1600,6 +2730,11 @@ "triple-beam": "^1.3.0" } }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -1608,6 +2743,21 @@ "yallist": "^4.0.0" } }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -1618,6 +2768,11 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -1654,6 +2809,19 @@ "resolved": "https://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz", "integrity": "sha1-0VNn5cuHQyuhF9K/gP30Wuz7QkY=" }, + "node-localstorage": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-2.2.1.tgz", + "integrity": "sha512-vv8fJuOUCCvSPjDjBLlMqYMHob4aGjkmrkaE42/mZr0VT+ZAU10jRF8oTnX9+pgU9/vYJ8P7YT3Vd6ajkmzSCw==", + "requires": { + "write-file-atomic": "^1.1.4" + } + }, + "normalize-url": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==" + }, "npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -1662,6 +2830,11 @@ "path-key": "^3.0.0" } }, + "object-inspect": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==" + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1686,6 +2859,11 @@ "mimic-fn": "^2.1.0" } }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==" + }, "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -1707,6 +2885,24 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, + "package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "requires": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -1732,6 +2928,11 @@ "xmldom": "^0.5.0" } }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -1785,6 +2986,40 @@ "once": "^1.3.1" } }, + "pupa": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", + "requires": { + "escape-goat": "^2.0.0" + } + }, + "qs": { + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", + "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "requires": { + "side-channel": "^1.0.4" + } + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + } + } + }, "read": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", @@ -1808,6 +3043,22 @@ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" }, + "registry-auth-token": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "requires": { + "rc": "^1.2.8" + } + }, + "registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "requires": { + "rc": "^1.2.8" + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -1823,6 +3074,14 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "requires": { + "lowercase-keys": "^1.0.0" + } + }, "revalidator": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz", @@ -1849,6 +3108,21 @@ "lru-cache": "^6.0.0" } }, + "semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "requires": { + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -1867,6 +3141,16 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", @@ -1880,6 +3164,11 @@ "is-arrayish": "^0.3.1" } }, + "slide": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" + }, "stack-trace": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", @@ -1916,21 +3205,89 @@ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, "text-hex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" }, + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==" + }, "triple-beam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "requires": { + "crypto-random-string": "^2.0.0" + } + }, "universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" }, + "update-notifier": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", + "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", + "requires": { + "boxen": "^5.0.0", + "chalk": "^4.1.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.4.0", + "is-npm": "^5.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.1.0", + "pupa": "^2.1.1", + "semver": "^7.3.4", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + } + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "requires": { + "prepend-http": "^2.0.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -1969,6 +3326,14 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, + "widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "requires": { + "string-width": "^4.0.0" + } + }, "winston": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz", @@ -2038,6 +3403,21 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, + "write-file-atomic": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + }, + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==" + }, "xmlbuilder": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", diff --git a/package.json b/package.json index f398898..64a02c2 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,13 @@ "execa": "^4.0.3", "fs-extra": "^9.0.1", "http-proxy": "^1.18.1", + "node-localstorage": "^2.2.1", "plist": "^3.0.2", "prompt": "^1.0.0", + "qs": "^6.10.3", "rimraf": "^2.7.1", "semver": "^7.3.2", + "update-notifier": "^5.1.0", "winston": "^3.3.3", "yargs": "^15.4.0", "yarn": "^1.22.10" diff --git a/src/expo-launcher.js b/src/expo-launcher.js index fe26297..28e88f0 100644 --- a/src/expo-launcher.js +++ b/src/expo-launcher.js @@ -6,19 +6,15 @@ const httpProxy = require('http-proxy'); const { exec } = require('./exec'); -const rootDir = `${require('os').homedir()}/.wm-reactnative-cli`; const {VERSIONS, hasValidExpoVersion} = require('./requirements'); -const tempDir = rootDir + '/temp'; const axios = require('axios'); +const { setupProject } = require('./project-sync.service'); //const openTerminal = require('open-terminal').default; -const MAX_REQUEST_ALLOWED_TIME = 5 * 60 * 1000; const proxyPort = 19009; -fs.mkdirSync(tempDir, {recursive: true}); const loggerLabel = 'expo-launcher'; function installGlobalNpmPackage(package) { return exec('npm', ['install', '-g', package]); } -let lastSyncTime = 0; function launchServiceProxy(previewUrl) { const ip = getIpAddress(); @@ -62,7 +58,7 @@ function getIpAddress() { return 'localhost'; } -async function transpile(projectDir) { +async function transpile(projectDir, previewUrl, useServiceProxy) { let codegen = process.env.WAVEMAKER_STUDIO_FRONTEND_CODEBASE; if (codegen) { codegen = `${codegen}/wavemaker-rn-codegen/build/index.js`; @@ -78,6 +74,15 @@ async function transpile(projectDir) { }); codegen = `${wmProjectDir}/temp/node_modules/@wavemaker/rn-codegen/index.js`; } + const wmProjectDir = getWmProjectDir(projectDir); + const configJSONFile = `${wmProjectDir}/wm_rn_config.json`; + const config = require(configJSONFile); + if (useServiceProxy) { + config.serverPath = `http://${getIpAddress()}:${proxyPort}`; + } else if (config.serverPath === '{{DEVELOPMENT_URL}}') { + config.serverPath = previewUrl; + } + fs.writeFileSync(configJSONFile, JSON.stringify(config, null, 4)); await exec('node', [codegen, 'transpile', '--profile="expo-preview"', getWmProjectDir(projectDir), getExpoProjectDir(projectDir)]); @@ -104,35 +109,6 @@ async function launchExpo(projectDir, web) { }); } -async function downloadProject(previewUrl) { - const tempFile = `${tempDir}/changes_${Date.now()}.zip`; - const res = await axios.get(`${previewUrl}/resources/ui-source.zip?after=${lastSyncTime}`, { - timeout: MAX_REQUEST_ALLOWED_TIME, - responseType: 'stream' - }).catch(error => error.response); - lastSyncTime = (res.headers && res.headers['x-wm-exported-at']) || lastSyncTime; - if (res.status === 304) { - return ''; - } - if (res.status !== 200) { - throw new Error('failed to download the zip'); - } - await new Promise((resolve, reject) => { - const fw = fs.createWriteStream(tempFile); - res.data.pipe(fw); - fw.on('error', err => { - reject(err); - fw.close(); - }); - fw.on('close', resolve); - }); - logger.info({ - label: loggerLabel, - message: 'downloaded the base zip.' - }); - return tempFile; -} - function clean(path) { if (fs.existsSync(path)) { rimraf.sync(path); @@ -140,60 +116,51 @@ function clean(path) { fs.mkdirSync(path, {recursive: true}); } +async function getProjectName(previewUrl) { + return JSON.parse( + (await axios.get(`${previewUrl}/services/application/wmProperties.js`)) + .data.split('=')[1].replace(';', '')).displayName; +} + function getWmProjectDir(projectDir) { - return `${projectDir}/wm-project`; + return `${projectDir}/src/main/webapp`; } function getExpoProjectDir(projectDir) { - return `${projectDir}/expo-project`; + return `${projectDir}/generated-rn-app`; } -async function setup(zipFile, previewUrl, useServiceProxy, _clean) { - const tempProjectDir = `${tempDir}/${Date.now()}`; - await exec('unzip', ['-o', zipFile, '-d', tempProjectDir], { - log: false - }); - const configJSONFile = `${tempProjectDir}/wm_rn_config.json`; - const config = require(configJSONFile); - if (useServiceProxy) { - config.serverPath = `http://${getIpAddress()}:${proxyPort}`; - } else if (config.serverPath === '{{DEVELOPMENT_URL}}') { - config.serverPath = previewUrl; - } - fs.writeFileSync(configJSONFile, JSON.stringify(config, null, 4)); - const projectDir = `${rootDir}/build/${config.id}`; - const wmProjectDir = getWmProjectDir(projectDir); - const expoProjectDir = getExpoProjectDir(projectDir); +async function setup(previewUrl, useServiceProxy, _clean) { + const projectName = await getProjectName(previewUrl); + const projectDir = `${global.rootDir}/wm-projects/${projectName}`; if (_clean) { - clean(wmProjectDir); - clean(expoProjectDir); - } - fs.copySync(tempProjectDir, wmProjectDir); - rimraf.sync(tempProjectDir); - rimraf.sync(zipFile); - return projectDir; -} - -async function syncLocalWMProject(previewUrl, useServiceProxy, clean) { - const zipFile = await downloadProject(previewUrl); - if (zipFile) { - const projectDir = await setup(zipFile, previewUrl, useServiceProxy, clean); - await transpile(projectDir); - return projectDir; + clean(projectDir); + } else { + fs.mkdirpSync(getWmProjectDir(previewUrl)); } + const syncProject = await setupProject(previewUrl, projectName, projectDir); + await transpile(projectDir, previewUrl, useServiceProxy); + return {projectDir, syncProject}; } -async function checkForChanges(previewUrl, useServiceProxy) { +async function watchProjectChanges(previewUrl, useServiceProxy, onChange, lastModifiedOn) { try { - await syncLocalWMProject(previewUrl, useServiceProxy); + const response = await axios.get(`${previewUrl}/rn-bundle/index.html`, { + headers: { + 'if-modified-since' : lastModifiedOn || new Date().toString() + } + }).catch((e) => e.response); + if (response.status === 200 && response.data.indexOf('WaveMaker Preview') > 0) { + lastModifiedOn = response.headers['last-modified']; + onChange(); + } } catch(e) { logger.debug({ label: loggerLabel, message: e }); } - const current = Date.now(); - setTimeout(() => checkForChanges(previewUrl, useServiceProxy, current), 5000); + setTimeout(() => watchProjectChanges(previewUrl, useServiceProxy, onChange, lastModifiedOn), 5000); } async function runExpo(previewUrl, web, clean) { @@ -207,13 +174,15 @@ async function runExpo(previewUrl, web, clean) { }); await installGlobalNpmPackage('expo-cli@' + VERSIONS.EXPO); } - const projectDir = await syncLocalWMProject(previewUrl, useServiceProxy, clean); + const {projectDir, syncProject} = await setup(previewUrl, useServiceProxy, clean); await installDependencies(projectDir); if (useServiceProxy) { launchServiceProxy(previewUrl); } launchExpo(projectDir, web); - checkForChanges(previewUrl, useServiceProxy); + watchProjectChanges(previewUrl, useServiceProxy, () => { + syncProject().then(() => transpile(projectDir, previewUrl, useServiceProxy)); + }); } catch(e) { logger.error({ label: loggerLabel, diff --git a/src/project-sync.service.js b/src/project-sync.service.js new file mode 100644 index 0000000..c84b04c --- /dev/null +++ b/src/project-sync.service.js @@ -0,0 +1,177 @@ +const { URL } = require('url'); +const fs = require('fs-extra'); +const logger = require('./logger'); +const prompt = require('prompt'); +const axios = require('axios'); +const os = require('os'); +const qs = require('qs'); +const { exec } = require('./exec'); + +//const PULL_URL = '/studio/services/projects/${projectId}/vcs/remoteChanges'; +const STORE_KEY = 'user.auth.token'; +const MAX_REQUEST_ALLOWED_TIME = 5 * 60 * 1000; +const loggerLabel = 'project-sync-service'; + + +async function pullChanges(projectDir) { + await exec('mvn', ['wavemaker-workspace:pull'], { + cwd: projectDir + }); +} + +async function findProjectId(config) { + const projectList = (await axios.get(`${config.baseUrl}/edn-services/rest/users/projects/list`, + {headers: { + cookie: config.authCookie + }})).data; + const project = projectList.filter(p => p.displayName === config.projectName); + return project && project.length && project[0].studioProjectId; +} + +async function downloadProject(config, projectDir) { + const start = Date.now(); + logger.info({ + label: loggerLabel, + message: 'downloading the project.' + }); + const projectId = await findProjectId(config); + const fileId = (await axios.post(`${config.baseUrl}/studio/services/projects/${projectId}/export`, + JSON.stringify({exportType: "ZIP", targetName: "BugZ"}), + { + headers: { + cookie: config.authCookie, + 'content-type': 'application/json;charset=UTF-8' + } + })).data.result; + const tempFile = `${os.tmpdir()}/changes_${Date.now()}.zip`; + const res = await axios.get(`${config.baseUrl}/file-service/${fileId}`, { + responseType: 'stream' + }); + if (res.status !== 200) { + throw new Error('failed to download the project'); + } + await new Promise((resolve, reject) => { + const fw = fs.createWriteStream(tempFile); + res.data.pipe(fw); + fw.on('error', err => { + reject(err); + fw.close(); + }); + fw.on('close', resolve); + }); + fs.mkdirpSync(projectDir); + await exec('unzip', ['-o', tempFile, '-d', projectDir], { + log: false + }); + logger.info({ + label: loggerLabel, + message: `downloaded the project in (${Date.now() - start} ms).` + }); + return tempFile; +} + +function initWorkspace() { + +} + +function pullChanges() { + +} + +function extractAuthCookie(res) { + const headers = res && res.response && res.response.headers; + if (!headers) { + return; + } + const result = headers['set-cookie'].filter(s => s.indexOf('auth_cookie') >= 0); + if (result.length) { + return result[0].split(';')[0]; + } +} + +async function authenticate(config) { + const credentials = await getUserCredentials(); + //const credentials = {username: 'srinivasa.boyina@wavemaker.com', password: 'Pramati@123'}; + return axios.post(`${config.baseUrl}/login/authenticate`, + qs.stringify({ + j_username: credentials.username, + j_password: credentials.password + }), { + maxRedirects: 0 + }).catch((res) => { + const cookie = extractAuthCookie(res); + if (!cookie) { + console.log('Not able to login. Try again.'); + return authenticate(config); + } + return cookie; + }); +} + +function getUserCredentials() { + var schema = { + properties: { + username: { + required: true + }, + password: { + required: true, + hidden: true + } + } + }; + prompt.start(); + return new Promise((resolve, reject) => { + prompt.get(schema, (err, result) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); +} + +async function checkAuthCookie(config) { + try { + await axios.get(`${config.baseUrl}/studio/services/auth/token`, { + headers: { + cookie: config.authCookie + }, + maxRedirects: 0 + }); + logger.info({ + label: loggerLabel, + message: `user authenticated.` + }); + } catch(e) { + return false; + } + return true; +} + +async function setup(previewUrl, projectName) { + const config = { + authCookie : global.localStorage.getItem(STORE_KEY) || '', + baseUrl: new URL(previewUrl).origin, + appPreviewUrl: previewUrl, + projectName: projectName + }; + const isAuthenticated = await checkAuthCookie(config); + if (!isAuthenticated) { + console.log(`Need to login to Studio (${config.baseUrl}). \n Please enter your Studio credentails.`); + config.authCookie = await authenticate(config); + global.localStorage.setItem(STORE_KEY, config.authCookie) + } + return config; +} + +async function setupProject(previewUrl, projectName, toDir) { + const config = await setup(previewUrl, projectName); + await downloadProject(config, toDir); + return () => downloadProject(config, toDir); +}; + +module.exports = { + setupProject : setupProject +}; \ No newline at end of file From 5f3075dea33fc93739b8fadeb86fdf73b90611d9 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Thu, 17 Mar 2022 20:33:02 +0530 Subject: [PATCH 42/49] avoid issue with cors --- src/expo-launcher.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/expo-launcher.js b/src/expo-launcher.js index 28e88f0..54ecf99 100644 --- a/src/expo-launcher.js +++ b/src/expo-launcher.js @@ -30,13 +30,11 @@ function launchServiceProxy(previewUrl) { }).join('; '); });; } - if (req.method === 'OPTIONS') { - proxyRes.headers['access-control-allow-origin'] = `http://${ip}:19006`; - proxyRes.headers['access-control-allow-methods'] = proxyRes.headers['access-control-allow-methods'] || 'GET, PUT, POST, DELETE, OPTIONS'; - proxyRes.headers['access-control-allow-headers'] = proxyRes.headers['access-control-allow-headers'] || 'x-wm-xsrf-token'; - proxyRes.headers['access-control-allow-credentials'] = true; - proxyRes.headers['access-control-max-age'] = 1600; - } + proxyRes.headers['access-control-allow-origin'] = `http://localhost:19006`; + proxyRes.headers['access-control-allow-methods'] = 'GET, PUT, POST, DELETE, OPTIONS'; + //proxyRes.headers['access-control-allow-headers'] = proxyRes.headers['access-control-allow-headers'] || 'x-wm-xsrf-token'; + proxyRes.headers['access-control-allow-credentials'] = true; + proxyRes.headers['access-control-max-age'] = 1600; }).listen(proxyPort); logger.info({ label: loggerLabel, From a55a75abbf03bba683473af551fa8a14cc363ac1 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Mon, 4 Apr 2022 20:31:00 +0530 Subject: [PATCH 43/49] avoid cross origin request issue in local development with expo. --- package-lock.json | 707 +++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + src/expo-launcher.js | 47 +-- 3 files changed, 735 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4b67e46..e985330 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "plist": "^3.0.2", "prompt": "^1.0.0", "qs": "^6.10.3", + "request": "^2.88.2", "rimraf": "^2.7.1", "semver": "^7.3.2", "update-notifier": "^5.1.0", @@ -69,6 +70,21 @@ "node": ">=6" } }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "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" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-align": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", @@ -99,11 +115,32 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "engines": { + "node": ">=0.8" + } + }, "node_modules/async": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==" }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", @@ -112,6 +149,19 @@ "node": ">= 4.0.0" } }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" + }, "node_modules/axios": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", @@ -144,6 +194,14 @@ } ] }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, "node_modules/boxen": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", @@ -246,6 +304,11 @@ "node": ">=6" } }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -359,6 +422,17 @@ "text-hex": "1.0.x" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -435,6 +509,17 @@ "node": ">=0.4.0" } }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/decamelize": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-3.2.0.tgz", @@ -475,6 +560,14 @@ "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==" }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/dot-prop": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", @@ -491,6 +584,15 @@ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -544,6 +646,19 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "engines": [ + "node >=0.6.0" + ] + }, "node_modules/eyes": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", @@ -552,6 +667,16 @@ "node": "> 0.1.90" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, "node_modules/fast-safe-stringify": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", @@ -598,6 +723,27 @@ } } }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, "node_modules/fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -657,6 +803,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, "node_modules/glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -727,6 +881,27 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -783,6 +958,20 @@ "node": ">=8.0.0" } }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, "node_modules/human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -936,11 +1125,31 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, "node_modules/json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -952,6 +1161,20 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/keyv": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", @@ -1045,6 +1268,25 @@ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -1136,6 +1378,14 @@ "node": ">=8" } }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "engines": { + "node": "*" + } + }, "node_modules/object-inspect": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", @@ -1261,6 +1511,11 @@ "node": ">=8" } }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, "node_modules/plist": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.2.tgz", @@ -1331,6 +1586,11 @@ "node": ">=0.1.90" } }, + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -1340,6 +1600,14 @@ "once": "^1.3.1" } }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "engines": { + "node": ">=6" + } + }, "node_modules/pupa": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", @@ -1435,6 +1703,45 @@ "node": ">=8" } }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "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" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/request/node_modules/qs": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "engines": { + "node": ">=0.6" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -1499,6 +1806,11 @@ } ] }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "node_modules/semver": { "version": "7.3.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", @@ -1590,6 +1902,30 @@ "node": "*" } }, + "node_modules/sshpk": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", + "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "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" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/stack-trace": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", @@ -1670,11 +2006,39 @@ "node": ">=6" } }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/triple-beam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, "node_modules/type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -1740,6 +2104,14 @@ "url": "https://github.com/yeoman/update-notifier?sponsor=1" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/url-parse-lax": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", @@ -1777,6 +2149,28 @@ "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -2023,6 +2417,17 @@ "defer-to-connect": "^1.0.1" } }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-align": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", @@ -2044,16 +2449,44 @@ "color-convert": "^2.0.1" } }, + "asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, "async": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==" }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, "at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" + }, "axios": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", @@ -2072,6 +2505,14 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, "boxen": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", @@ -2148,6 +2589,11 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2245,6 +2691,14 @@ "text-hex": "1.0.x" } }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2306,6 +2760,14 @@ "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=" }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, "decamelize": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-3.2.0.tgz", @@ -2337,6 +2799,11 @@ "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==" }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, "dot-prop": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", @@ -2350,6 +2817,15 @@ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -2394,11 +2870,31 @@ "strip-final-newline": "^2.0.0" } }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, "eyes": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, "fast-safe-stringify": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", @@ -2428,6 +2924,21 @@ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==" }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, "fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -2472,6 +2983,14 @@ "pump": "^3.0.0" } }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, "glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -2526,6 +3045,20 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -2564,6 +3097,16 @@ "requires-port": "^1.0.0" } }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -2675,11 +3218,31 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, "json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" }, + "json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, "jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -2689,6 +3252,17 @@ "universalify": "^2.0.0" } }, + "jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + } + }, "keyv": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", @@ -2763,6 +3337,19 @@ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -2830,6 +3417,11 @@ "path-key": "^3.0.0" } }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, "object-inspect": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", @@ -2918,6 +3510,11 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, "plist": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.2.tgz", @@ -2977,6 +3574,11 @@ } } }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -2986,6 +3588,11 @@ "once": "^1.3.1" } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, "pupa": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", @@ -3059,6 +3666,40 @@ "rc": "^1.2.8" } }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "requires": { + "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" + }, + "dependencies": { + "qs": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==" + } + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3100,6 +3741,11 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "semver": { "version": "7.3.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", @@ -3169,6 +3815,22 @@ "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" }, + "sshpk": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", + "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "requires": { + "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" + } + }, "stack-trace": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", @@ -3228,11 +3890,33 @@ "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==" }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, "triple-beam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -3280,6 +3964,14 @@ "xdg-basedir": "^4.0.0" } }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, "url-parse-lax": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", @@ -3313,6 +4005,21 @@ } } }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index 64a02c2..ac38b25 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "plist": "^3.0.2", "prompt": "^1.0.0", "qs": "^6.10.3", + "request": "^2.88.2", "rimraf": "^2.7.1", "semver": "^7.3.2", "update-notifier": "^5.1.0", diff --git a/src/expo-launcher.js b/src/expo-launcher.js index 54ecf99..bfb21e6 100644 --- a/src/expo-launcher.js +++ b/src/expo-launcher.js @@ -1,5 +1,7 @@ const logger = require('./logger'); const fs = require('fs-extra'); +const http = require('http'); +const request = require('request'); const os = require('os'); const rimraf = require("rimraf"); const httpProxy = require('http-proxy'); @@ -17,28 +19,33 @@ function installGlobalNpmPackage(package) { } function launchServiceProxy(previewUrl) { - const ip = getIpAddress(); - httpProxy.createProxyServer({ - target: previewUrl, - changeOrigin: true - }).on('proxyRes', function (proxyRes, req, res) { - const cookies = proxyRes.headers['set-cookie']; - if (cookies) { - proxyRes.headers['set-cookie'] = cookies.map(c => { - return c.split(';').map(s => s.trim()).filter(cs => { - return !(cs.startsWith('Path') || cs.startsWith('Secure') || cs.startsWith('HttpOnly')); - }).join('; '); - });; + const proxy = httpProxy.createProxyServer({}); + http.createServer(function (req, res) { + let tUrl = req.url; + if (req.url.startsWith('/_/')) { + req.url = req.url.substring(3); + proxy.web(req, res, { + target: previewUrl, + xfwd: false, + changeOrigin: true, + cookiePathRewrite: { + "*": "" + } + }); + tUrl = `${previewUrl}/${req.url.substring(3)}`; + } else { + tUrl = `http://localhost:19006${req.url}`; + req.pipe(request(tUrl)).pipe(res); } - proxyRes.headers['access-control-allow-origin'] = `http://localhost:19006`; - proxyRes.headers['access-control-allow-methods'] = 'GET, PUT, POST, DELETE, OPTIONS'; - //proxyRes.headers['access-control-allow-headers'] = proxyRes.headers['access-control-allow-headers'] || 'x-wm-xsrf-token'; - proxyRes.headers['access-control-allow-credentials'] = true; - proxyRes.headers['access-control-max-age'] = 1600; - }).listen(proxyPort); + }).listen(80); + proxy.on('proxyReq', function(proxyReq, req, res, options) { + proxyReq.setHeader('sec-fetch-mode', 'no-cors'); + proxyReq.setHeader('origin', previewUrl); + proxyReq.setHeader('referer', previewUrl); + }); logger.info({ label: loggerLabel, - message: `Service proxy launched on ${proxyPort} .` + message: `Service proxy launched at http://localhost .` }); } @@ -76,7 +83,7 @@ async function transpile(projectDir, previewUrl, useServiceProxy) { const configJSONFile = `${wmProjectDir}/wm_rn_config.json`; const config = require(configJSONFile); if (useServiceProxy) { - config.serverPath = `http://${getIpAddress()}:${proxyPort}`; + config.serverPath = `http://localhost/_`; } else if (config.serverPath === '{{DEVELOPMENT_URL}}') { config.serverPath = previewUrl; } From 87e78ea0a5c3ace9dc5bf0044ef215fa9c362e7e Mon Sep 17 00:00:00 2001 From: bandhavya Date: Mon, 2 May 2022 14:13:49 +0530 Subject: [PATCH 44/49] Added proguard to true in release mode and shrinkResources is false --- src/android.js | 112 +++++++++++++++++++++-------------- src/command.js | 156 ++++++++++++++++++++++++++----------------------- 2 files changed, 151 insertions(+), 117 deletions(-) diff --git a/src/android.js b/src/android.js index 73eb5dd..e8f0154 100644 --- a/src/android.js +++ b/src/android.js @@ -86,11 +86,22 @@ function setSigningConfigInGradle() { generateAab(); } +function addKeepFileEntries() { + fs.mkdirSync(config.src + 'android/app/src/main/res/raw/', {recursive: true}); + const data = ` + `; + fs.appendFileSync(config.src + 'android/app/src/main/res/raw/keep.xml', data); +} + + async function generateAab(packageType) { try { + // addKeepFileEntries(); await exec('./gradlew', ['clean'], { cwd: config.src + 'android' }); + logger.info('****** invoking aab build *****'); if (packageType === 'bundle') { await exec('./gradlew', [':app:bundleRelease'], { cwd: config.src + 'android' @@ -110,36 +121,6 @@ async function generateAab(packageType) { } } -function setDebugFlagInGradle(content) { - let newContent; - if (content.search(`entryFile: "index.js"`) === -1) { - newContent = content.replace(/^(?!\s)project\.ext\.react = \[/gm, `project.ext.react = [ - entryFile: "index.js", - bundleAssetName: "index.android.bundle", - bundleInDebug: true, - devDisabledInDebug: true,`); - } else { - newContent = content.replace(/bundleInDebug\: false/gm, `bundleInDebug: true`) - .replace(/devDisabledInDebug\: false/gm, `devDisabledInDebug: true`) - .replace(/bundleInRelease\: true/gm, `bundleInRelease: false`); - } - return newContent; -} -function setReleaseFlagInGradle(content) { - let newContent; - if (content.search(`entryFile: "index.js"`) === -1) { - newContent = content.replace(/^(?!\s)project\.ext\.react = \[/gm, `project.ext.react = [ - entryFile: "index.js", - bundleAssetName: "index.android.bundle", - bundleInRelease: true,`); - } else { - newContent = content.replace(/bundleInDebug\: true/gm, `bundleInDebug: false, - bundleInRelease: true,`).replace(/devDisabledInDebug\: true/gm, ``) - .replace(/bundleInRelease\: false/gm, `bundleInRelease: true`); - } - return newContent; -} - const endWith = (str, suffix) => { if (!str.endsWith(suffix)) { return str += suffix; @@ -153,22 +134,66 @@ function findFile(path, nameregex) { return endWith(path, '/') + f; } -async function updateAndroidBuildGradleFile(type) { - const path = config.src + 'android/app/build.gradle'; - let data = fs.readFileSync(path, 'utf8'); - console.log(data); +function addProguardRule() { + const proguardRulePath = config.src + 'android/app/proguard-rules.pro'; + if (fs.existsSync(proguardRulePath)) { + var data = `-keep class com.facebook.react.turbomodule.** { *; }`; + fs.appendFileSync(proguardRulePath,data, 'utf8'); + logger.info('***** added proguard rule ******') + } +} - let content = fs.readFileSync(path, 'utf8'); - content = type === 'release' ? await setReleaseFlagInGradle(content) : await setDebugFlagInGradle(content); - await fs.writeFileSync(path, content); +function updateOptimizationFlags() { + logger.info('***** into optimization ******') + const buildGradlePath = config.src + 'android/app/build.gradle'; + if (fs.existsSync(buildGradlePath)) { + let content = fs.readFileSync(buildGradlePath, 'utf8'); + if (content.search(`def enableProguardInReleaseBuilds = false`) > -1) { + content = content.replace(/def enableProguardInReleaseBuilds = false/gm, `def enableProguardInReleaseBuilds = true`) + .replace(/minifyEnabled enableProguardInReleaseBuilds/gm, `minifyEnabled enableProguardInReleaseBuilds\n shrinkResources false\n`); + } + fs.writeFileSync(buildGradlePath, content); + } } -async function updateSettingsGradleFile(appName) { +function updateAndroidBuildGradleFile(type) { + const buildGradlePath = config.src + 'android/app/build.gradle'; + if (fs.existsSync(buildGradlePath)) { + let content = fs.readFileSync(buildGradlePath, 'utf8'); + if (type === 'release') { + if (content.search(`entryFile: "index.js"`) === -1) { + content = content.replace(/^(?!\s)project\.ext\.react = \[/gm, `project.ext.react = [ + entryFile: "index.js", + bundleAssetName: "index.android.bundle", + bundleInRelease: true,`); + } else { + content = content.replace(/bundleInDebug\: true/gm, `bundleInDebug: false, + bundleInRelease: true,`).replace(/devDisabledInDebug\: true/gm, ``) + .replace(/bundleInRelease\: false/gm, `bundleInRelease: true`); + } + } else { + if (content.search(`entryFile: "index.js"`) === -1) { + content = content.replace(/^(?!\s)project\.ext\.react = \[/gm, `project.ext.react = [ + entryFile: "index.js", + bundleAssetName: "index.android.bundle", + bundleInDebug: true, + devDisabledInDebug: true,`); + } else { + content = content.replace(/bundleInDebug\: false/gm, `bundleInDebug: true`) + .replace(/devDisabledInDebug\: false/gm, `devDisabledInDebug: true`) + .replace(/bundleInRelease\: true/gm, `bundleInRelease: false`); + } + } + fs.writeFileSync(buildGradlePath, content); + } +} + +function updateSettingsGradleFile(appName) { const path = config.src + 'android/settings.gradle'; let content = fs.readFileSync(path, 'utf8'); if (content.search(/^rootProject.name = \'\'/gm) > -1) { content = content.replace(/^rootProject.name = \'\'/gm, `rootProject.name = ${appName}`); - await fs.writeFileSync(path, content); + fs.writeFileSync(path, content); } } @@ -195,8 +220,7 @@ async function invokeAndroidBuild(args) { updateJSEnginePreference(); const appName = config.metaData.name; - await updateSettingsGradleFile(appName); - + updateSettingsGradleFile(appName); if (args.buildType === 'release') { const errors = validateForAndroid(keyStore, storePassword, keyAlias, keyPassword); if (errors.length > 0) { @@ -205,10 +229,12 @@ async function invokeAndroidBuild(args) { errors: errors } } - await updateAndroidBuildGradleFile(args.buildType); + addProguardRule(); + updateOptimizationFlags(); + updateAndroidBuildGradleFile(args.buildType); await generateSignedApk(keyStore, storePassword, keyAlias, keyPassword, args.packageType); } else { - await updateAndroidBuildGradleFile(args.buildType); + updateAndroidBuildGradleFile(args.buildType); logger.info({ label: loggerLabel, message: 'Updated build.gradle file with debug configuration' diff --git a/src/command.js b/src/command.js index d491705..f074e68 100644 --- a/src/command.js +++ b/src/command.js @@ -29,70 +29,43 @@ function getFileSize(path) { } async function updatePackageJsonFile(path) { - return await new Promise(resolve => { - try { - fs.readFile(path, async function(error, data) { - if (error) { - throw error; - } - var jsonData = JSON.parse(data); - jsonData['main'] = "index"; - await fs.writeFile(path, JSON.stringify(jsonData), error => { - if (error) { - throw error; - } - logger.info({ - 'label': loggerLabel, - 'message': 'updated package.json file' - }); - resolve('success'); - }); - }) - } catch (e) { - resolve('error', e); - } - }) + try { + let data = fs.readFileSync(path, 'utf-8'); + const jsonData = JSON.parse(data); + jsonData['main'] = "index"; + fs.writeFileSync(path, JSON.stringify(jsonData), 'utf-8'); + logger.info({ + 'label': loggerLabel, + 'message': 'updated package.json file' + }); + } catch (e) { + resolve('error', e); + } } -async function updateAppJsonFile(content, src) { - return await new Promise(resolve => { - try { - const path = (src || config.src) + 'app.json'; - if (fs.existsSync(path)) { - fs.readFile(path, async function(error, data) { - if (error) { - throw error; - } - var jsonData = JSON.parse(data); - if (content) { - Object.assign(jsonData['expo'], content); - } - if (config.metaData.id) { - jsonData['expo']['android']['package'] = config.metaData.id; - jsonData['expo']['ios']['bundleIdentifier'] = config.metaData.id; - } - jsonData['expo']['jsEngine'] = config.metaData.preferences.enableHermes ? 'hermes' : 'jsc'; - if (config.metaData.icon) { - jsonData['expo']['icon'] = config.metaData.icon.src; - jsonData['expo']['splash']['image'] = config.metaData.splash.src; - jsonData['expo']['android']['adaptiveIcon']['foregroundImage'] = config.metaData.icon.src; - } - await fs.writeFile(path, JSON.stringify(jsonData), error => { - if (error) { - throw error; - } - resolve('success'); - logger.info({ - 'label': loggerLabel, - 'message': 'updated app.json file' - }); - }) - }); - } - } catch (e) { - resolve('error', e); - } +function updateAppJsonFile(src) { + const path = (src || config.src) + 'app.json'; + logger.info({ + label: loggerLabel, + message: 'path at app.json ' + path }) + try { + if (fs.existsSync(path)) { + let data = fs.readFileSync(path, 'utf8'); + const jsonData = JSON.parse(data); + jsonData['expo']['name'] = config.metaData.name; + jsonData['expo']['slug'] = config.metaData.name; + jsonData['expo']['android']['package'] = config.metaData.id; + jsonData['expo']['ios']['bundleIdentifier'] = config.metaData.id; + jsonData['expo']['jsEngine'] = config.metaData.preferences.enableHermes ? 'hermes' : 'jsc'; + jsonData['expo']['icon'] = config.metaData.icon.src; + jsonData['expo']['splash']['image'] = config.metaData.splash.src; + jsonData['expo']['android']['adaptiveIcon']['foregroundImage'] = config.metaData.icon.src; + fs.writeFileSync(path, JSON.stringify(jsonData), 'utf-8'); + } + } catch (e) { + resolve('error', e); + } } async function build(args) { @@ -147,6 +120,7 @@ async function updateAppJsonFile(content, src) { try { let result; + clearUnusedAssets(config.platform); if (config.platform === 'android') { result = await android.invokeAndroidBuild(args); } else if (config.platform === 'ios') { @@ -332,22 +306,15 @@ async function ejectProject(args) { success: false } } - await updateAppJsonFile({ - 'name': config.metaData.name, - 'slug': config.metaData.name - }, config.src); + updateAppJsonFile(config.src); + logger.info({ + label: loggerLabel, + message: 'app.json updated.... ' + args.dest + }) await updatePackageJsonFile(config.src + 'package.json'); await exec('yarn', ['install'], { cwd: config.src }); - // expo eject checks whether src is a git repo or not - await exec('git', ['init'], { - cwd: config.src - }); - logger.info({ - 'label': loggerLabel, - 'message': 'invoking expo eject' - }); await exec('expo', ['eject'], { cwd: config.src }); @@ -368,7 +335,6 @@ async function ejectProject(args) { 'message': 'copied the app-rn-runtime folder' }) } - await writeWmRNConfig({ejected: true}); } catch (e) { logger.error({ label: loggerLabel, @@ -378,6 +344,48 @@ async function ejectProject(args) { } } +function clearUnusedAssets(platform) { + const themeFile = config.src + 'app.theme.js'; + let content = fs.readFileSync(themeFile, 'utf8'); + + if (platform === 'ios') { + content = content.replace(/import androidTheme from \'.\/theme\/android\/style.js\';/gm, ``); + } else { + content = content.replace(/import iosTheme from \'.\/theme\/ios\/style.js\';/gm, ``); + } + fs.writeFileSync(themeFile, content); + + const themeVariablesFile = config.src + 'app.theme.variables.js'; + let variablesContent = fs.readFileSync(themeVariablesFile, 'utf8'); + + if (platform === 'ios') { + variablesContent = variablesContent.replace(/import androidThemeVariables from \'.\/theme\/android\/variables.js\';/gm, ``); + } else { + variablesContent = variablesContent.replace(/import iosThemeVariables from \'.\/theme\/ios\/variables.js\';/gm, ``); + } + fs.writeFileSync(themeVariablesFile, variablesContent); + + logger.info({ + 'label': loggerLabel, + 'message': '***** updated theme related files based on selected platform ...***' + }); + + const folderToExclude = platform === 'android' ? 'ios' : 'android'; + const path = config.src + 'theme/' + folderToExclude; + if (fs.existsSync(path)) { + const fsStat = fs.lstatSync(path); + if (fsStat.isDirectory()) { + fs.removeSync(path); + } else if (fsStat.isFile()) { + fs.unlinkSync(path); + } + logger.info({ + 'label': loggerLabel, + 'message': '***** Removed the unused platform theme folder ...***' + }); + } +} + module.exports = { ejectProject: ejectProject, build: build From 74bfb487667867e9e6a8c51aa950dafc67336a79 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Fri, 13 May 2022 10:39:38 +0530 Subject: [PATCH 45/49] changed port from 80 to 19009 --- src/expo-launcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expo-launcher.js b/src/expo-launcher.js index bfb21e6..86e1c28 100644 --- a/src/expo-launcher.js +++ b/src/expo-launcher.js @@ -37,7 +37,7 @@ function launchServiceProxy(previewUrl) { tUrl = `http://localhost:19006${req.url}`; req.pipe(request(tUrl)).pipe(res); } - }).listen(80); + }).listen(proxyPort); proxy.on('proxyReq', function(proxyReq, req, res, options) { proxyReq.setHeader('sec-fetch-mode', 'no-cors'); proxyReq.setHeader('origin', previewUrl); From 7c1b03c3084f89b3cf47a34802d51b10c5ba83e7 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Fri, 13 May 2022 11:12:17 +0530 Subject: [PATCH 46/49] fixed service error --- src/expo-launcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expo-launcher.js b/src/expo-launcher.js index 86e1c28..81ed56e 100644 --- a/src/expo-launcher.js +++ b/src/expo-launcher.js @@ -83,7 +83,7 @@ async function transpile(projectDir, previewUrl, useServiceProxy) { const configJSONFile = `${wmProjectDir}/wm_rn_config.json`; const config = require(configJSONFile); if (useServiceProxy) { - config.serverPath = `http://localhost/_`; + config.serverPath = `http://localhost:${proxyPort}/_`; } else if (config.serverPath === '{{DEVELOPMENT_URL}}') { config.serverPath = previewUrl; } From 8d15afcdae916cde993f0f0d58f7130bd6c86951 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Mon, 16 May 2022 18:04:31 +0530 Subject: [PATCH 47/49] proxy service url has to be accessed with ip address to open app in expo. --- src/expo-launcher.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/expo-launcher.js b/src/expo-launcher.js index 81ed56e..6305025 100644 --- a/src/expo-launcher.js +++ b/src/expo-launcher.js @@ -13,6 +13,7 @@ const axios = require('axios'); const { setupProject } = require('./project-sync.service'); //const openTerminal = require('open-terminal').default; const proxyPort = 19009; +const proxyUrl = `http://${getIpAddress()}:${proxyPort}`; const loggerLabel = 'expo-launcher'; function installGlobalNpmPackage(package) { return exec('npm', ['install', '-g', package]); @@ -45,7 +46,7 @@ function launchServiceProxy(previewUrl) { }); logger.info({ label: loggerLabel, - message: `Service proxy launched at http://localhost .` + message: `Service proxy launched at ${proxyUrl} .` }); } @@ -83,7 +84,7 @@ async function transpile(projectDir, previewUrl, useServiceProxy) { const configJSONFile = `${wmProjectDir}/wm_rn_config.json`; const config = require(configJSONFile); if (useServiceProxy) { - config.serverPath = `http://localhost:${proxyPort}/_`; + config.serverPath = `${proxyUrl}/_`; } else if (config.serverPath === '{{DEVELOPMENT_URL}}') { config.serverPath = previewUrl; } From 2a2317e3d6852863a807b8729572359767e560b3 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Boyina <2254369+sboyina@users.noreply.github.com> Date: Wed, 25 May 2022 09:18:35 +0530 Subject: [PATCH 48/49] adjusted the new requirements of environment. --- src/requirements.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/requirements.js b/src/requirements.js index 239b10b..45ce763 100644 --- a/src/requirements.js +++ b/src/requirements.js @@ -9,11 +9,11 @@ const { } = require('./exec'); const loggerLabel = 'rn-cli-requirements'; const VERSIONS = { - 'NODE': '12.0.0', + 'NODE': '14.0.0', 'POD' : '1.9.0', - 'JAVA': '1.8.0', - 'REACT_NATIVE': '0.63.4', - 'EXPO': '4.7.3', + 'JAVA': '11.0.0', + 'REACT_NATIVE': '0.68.2', + 'EXPO': '5.4.4', } // check if expo cli is installed globally or not From 06dfb1118f7a18e4fa03dd58c2f8724d0161ad60 Mon Sep 17 00:00:00 2001 From: bandhavya Date: Wed, 25 May 2022 10:23:08 +0530 Subject: [PATCH 49/49] JAVA version for ios is still jdk8 --- src/command.js | 6 +++++- src/requirements.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/command.js b/src/command.js index f074e68..fd61ea7 100644 --- a/src/command.js +++ b/src/command.js @@ -3,7 +3,7 @@ const logger = require('./logger'); const plist = require('plist'); const path = require('path'); const android = require('./android'); -const { showConfirmation } = require('./requirements'); +const { showConfirmation, VERSIONS } = require('./requirements'); const { exec @@ -299,6 +299,10 @@ async function ejectProject(args) { config.platform = args.platform; config.buildType = args.buildType; + if (args.platform !== 'android') { + VERSIONS.JAVA = '1.8.0'; + } + if (!await hasValidNodeVersion() || !await hasValidJavaVersion() || !await hasYarnPackage() || !await checkForGradleAvailability() || !await isGitInstalled() || !await hasValidExpoVersion()) { return { diff --git a/src/requirements.js b/src/requirements.js index 45ce763..9aadcbc 100644 --- a/src/requirements.js +++ b/src/requirements.js @@ -8,7 +8,7 @@ const { exec } = require('./exec'); const loggerLabel = 'rn-cli-requirements'; -const VERSIONS = { +let VERSIONS = { 'NODE': '14.0.0', 'POD' : '1.9.0', 'JAVA': '11.0.0',