From d972933876ec56fc945dc4bb6ff699ea53597ba9 Mon Sep 17 00:00:00 2001 From: Ian Lavery Date: Tue, 20 Aug 2024 13:27:30 -0700 Subject: [PATCH] Update web launch scripts (#844) --- .github/workflows/angular-demos.yml | 3 ++- .github/workflows/react-demos.yml | 3 ++- .github/workflows/vue-demos.yml | 3 ++- demo/angular/scripts/run_demo.js | 7 ++++--- demo/react-native-clock/android/gradle.properties | 2 +- demo/react-native-clock/ios/Podfile | 7 +++++++ demo/react-native/android/gradle.properties | 2 +- demo/react-native/ios/Podfile | 8 ++++++++ demo/react-native/ios/Podfile.lock | 14 +++++++------- demo/react-native/scripts/run_demo.js | 7 ++++--- demo/react/scripts/run_demo.js | 7 ++++--- demo/vue/scripts/run_demo.js | 7 ++++--- demo/web/scripts/run_demo.js | 5 +++-- 13 files changed, 49 insertions(+), 26 deletions(-) diff --git a/.github/workflows/angular-demos.yml b/.github/workflows/angular-demos.yml index b87c63974..e0ecf9bba 100644 --- a/.github/workflows/angular-demos.yml +++ b/.github/workflows/angular-demos.yml @@ -21,10 +21,11 @@ defaults: jobs: build-demos: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-latest, windows-latest, macos-latest] node-version: [16.x, 18.x, 20.x] steps: diff --git a/.github/workflows/react-demos.yml b/.github/workflows/react-demos.yml index 091c00af2..d76edc2a1 100644 --- a/.github/workflows/react-demos.yml +++ b/.github/workflows/react-demos.yml @@ -21,10 +21,11 @@ defaults: jobs: build-demos: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-latest, windows-latest, macos-latest] node-version: [16.x, 18.x, 20.x] steps: diff --git a/.github/workflows/vue-demos.yml b/.github/workflows/vue-demos.yml index 0ce0d233e..ccf47580a 100644 --- a/.github/workflows/vue-demos.yml +++ b/.github/workflows/vue-demos.yml @@ -21,10 +21,11 @@ defaults: jobs: build-demos: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-latest, windows-latest, macos-latest] node-version: [16.x, 18.x, 20.x] steps: diff --git a/demo/angular/scripts/run_demo.js b/demo/angular/scripts/run_demo.js index 140eda139..cd829b0da 100644 --- a/demo/angular/scripts/run_demo.js +++ b/demo/angular/scripts/run_demo.js @@ -5,7 +5,7 @@ const testData = require("../../../resources/.test/test_data.json"); const availableLanguages = testData["tests"]["parameters"].map((x) => x["language"]); -const commands = process.argv.slice(2, -1); +const args = process.argv.slice(2, -1); const language = process.argv.slice(-1)[0]; if (!availableLanguages.includes(language)) { @@ -141,6 +141,7 @@ const rhinoModel = { const command = (process.platform === "win32") ? "npx.cmd" : "npx"; -child_process.fork("ng", commands, { - execPath: command, +child_process.execSync(`${command} ng ${args.join(" ")}`, { + shell: true, + stdio: 'inherit' }); diff --git a/demo/react-native-clock/android/gradle.properties b/demo/react-native-clock/android/gradle.properties index 3bdbd3d4e..cdb4c2110 100644 --- a/demo/react-native-clock/android/gradle.properties +++ b/demo/react-native-clock/android/gradle.properties @@ -25,4 +25,4 @@ android.useAndroidX=true android.enableJetifier=true # Version of flipper SDK to use with React Native -FLIPPER_VERSION=0.54.0 +FLIPPER_VERSION=0.99.0 diff --git a/demo/react-native-clock/ios/Podfile b/demo/react-native-clock/ios/Podfile index 25e4fb71b..567316ded 100644 --- a/demo/react-native-clock/ios/Podfile +++ b/demo/react-native-clock/ios/Podfile @@ -8,3 +8,10 @@ target 'ReactNativeClock' do use_react_native!(:path => config["reactNativePath"]) end +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION'] + end + end +end diff --git a/demo/react-native/android/gradle.properties b/demo/react-native/android/gradle.properties index 3bdbd3d4e..cdb4c2110 100644 --- a/demo/react-native/android/gradle.properties +++ b/demo/react-native/android/gradle.properties @@ -25,4 +25,4 @@ android.useAndroidX=true android.enableJetifier=true # Version of flipper SDK to use with React Native -FLIPPER_VERSION=0.54.0 +FLIPPER_VERSION=0.99.0 diff --git a/demo/react-native/ios/Podfile b/demo/react-native/ios/Podfile index f3ee22519..07d61fcf1 100644 --- a/demo/react-native/ios/Podfile +++ b/demo/react-native/ios/Podfile @@ -7,3 +7,11 @@ target 'PicovoiceDemo' do config = use_native_modules! use_react_native!(:path => config["reactNativePath"]) end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION'] + end + end +end diff --git a/demo/react-native/ios/Podfile.lock b/demo/react-native/ios/Podfile.lock index 9d28cb2d0..e826a9380 100644 --- a/demo/react-native/ios/Podfile.lock +++ b/demo/react-native/ios/Podfile.lock @@ -14,7 +14,7 @@ PODS: - ios-voice-processor (1.1.0) - Porcupine-iOS (3.0.1): - ios-voice-processor (~> 1.1.0) - - porcupine-react-native (3.0.1): + - porcupine-react-native (3.0.2): - Porcupine-iOS (~> 3.0.1) - React - RCT-Folly (2021.06.28.00-v2): @@ -224,7 +224,7 @@ PODS: - React-jsinspector (0.68.7) - React-logger (0.68.7): - glog - - react-native-voice-processor (1.2.0): + - react-native-voice-processor (1.2.2): - ios-voice-processor (~> 1.1.0) - React-Core - React-perflogger (0.68.7) @@ -294,7 +294,7 @@ PODS: - React-perflogger (= 0.68.7) - Rhino-iOS (3.0.1): - ios-voice-processor (~> 1.1.0) - - rhino-react-native (3.0.1): + - rhino-react-native (3.0.2): - React - Rhino-iOS (~> 3.0.1) - Yoga (1.14.0) @@ -423,7 +423,7 @@ SPEC CHECKSUMS: glog: 476ee3e89abb49e07f822b48323c51c57124b572 ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1 Porcupine-iOS: 6d69509fa587f3ac0be1adfefb48e0c6ce029fff - porcupine-react-native: f6650a418ba767c210eeb416d4e0bdbb93a209ca + porcupine-react-native: 8d7374c0fea2fa6ad645139f33150290a56f574e RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8 RCTRequired: 530916cd48c5f7cf1fc16966ad5ea01638ca4799 RCTTypeSafety: 5fb4cb3080efd582e5563c3e9a0e459fc51396c5 @@ -437,7 +437,7 @@ SPEC CHECKSUMS: React-jsiexecutor: 7c0bd030a84f2ec446fb104b7735af2f5ed11eea React-jsinspector: cab4d37ebde480f84c79ac89568abbf76b916c3e React-logger: b75b80500ea80457b2cf169427d66de986cdcb29 - react-native-voice-processor: aefb0845641c7d67dd47e69606ba7ebb38aab5cd + react-native-voice-processor: 6f8e5236d1a370be02aa87da8e34aa26506678df React-perflogger: 44436b315d757100a53dfb1ab6b77c58cb646d7d React-RCTActionSheet: 1888a229684762c40cc96c7ff4716f809655dc09 React-RCTAnimation: f05da175751867521d14b02ab4d3994a7b96f131 @@ -451,9 +451,9 @@ SPEC CHECKSUMS: React-runtimeexecutor: 18932e685b4893be88d1efc18f5f8ca1c9cd39d8 ReactCommon: 29bb6fad3242e30e9d049bc9d592736fa3da9e50 Rhino-iOS: 4eeb02b38696907b28dd6f5dfa3a8f25355554ca - rhino-react-native: 8ef93ffeb956ad0c4843dfe0391df92cb9d290a6 + rhino-react-native: c81671ddc7ead256db11f7457261ee193ad0ebde Yoga: 0bc4b37c3b8a345336ff601e2cf7d9704bab7e93 -PODFILE CHECKSUM: 23f30bbdcb7d9683faf5ac618e55addfe5c42cb2 +PODFILE CHECKSUM: f5a6d2be82867f800e8f2a13e5942db9296f2cb4 COCOAPODS: 1.11.3 diff --git a/demo/react-native/scripts/run_demo.js b/demo/react-native/scripts/run_demo.js index 6d68ee514..d9845d300 100644 --- a/demo/react-native/scripts/run_demo.js +++ b/demo/react-native/scripts/run_demo.js @@ -5,7 +5,7 @@ const testData = require('../../../resources/.test/test_data.json'); const availableLanguages = testData.tests.parameters.map((x) => x.language); -const commands = process.argv.slice(2, -1); +const args = process.argv.slice(2, -1); const language = process.argv.slice(-1)[0]; if (!availableLanguages.includes(language)) { console.error( @@ -143,6 +143,7 @@ fs.writeFileSync( const command = process.platform === 'win32' ? 'npx.cmd' : 'npx'; -child_process.fork('react-native', commands, { - execPath: command, +child_process.execSync(`${command} react-native ${args.join(' ')}`, { + shell: true, + stdio: 'inherit', }); diff --git a/demo/react/scripts/run_demo.js b/demo/react/scripts/run_demo.js index 6551586bf..bd812a170 100644 --- a/demo/react/scripts/run_demo.js +++ b/demo/react/scripts/run_demo.js @@ -5,7 +5,7 @@ const testData = require("../../../resources/.test/test_data.json"); const availableLanguages = testData["tests"]["parameters"].map((x) => x["language"]); -const commands = process.argv.slice(2, -1); +const args = process.argv.slice(2, -1); const language = process.argv.slice(-1)[0]; if (!availableLanguages.includes(language)) { @@ -141,6 +141,7 @@ const rhinoModel = { const command = (process.platform === "win32") ? "npx.cmd" : "npx"; -child_process.fork("react-scripts", commands, { - execPath: command, +child_process.execSync(`${command} react-scripts ${args.join(" ")}`, { + shell: true, + stdio: 'inherit' }); diff --git a/demo/vue/scripts/run_demo.js b/demo/vue/scripts/run_demo.js index bfa621fa3..4aca498cb 100644 --- a/demo/vue/scripts/run_demo.js +++ b/demo/vue/scripts/run_demo.js @@ -7,7 +7,7 @@ const availableLanguages = testData["tests"]["parameters"].map( x => x["language"] ); -const commands = process.argv.slice(2, -1); +const args = process.argv.slice(2, -1); const language = process.argv.slice(-1)[0]; if (!availableLanguages.includes(language)) { @@ -137,6 +137,7 @@ export { porcupineModel, rhinoModel }; const command = (process.platform === "win32") ? "npx.cmd" : "npx"; -child_process.fork("vite", commands, { - execPath: command, +child_process.execSync(`${command} vite ${args.join(" ")}`, { + shell: true, + stdio: 'inherit' }); diff --git a/demo/web/scripts/run_demo.js b/demo/web/scripts/run_demo.js index bea13dafc..9adb0d49a 100644 --- a/demo/web/scripts/run_demo.js +++ b/demo/web/scripts/run_demo.js @@ -147,6 +147,7 @@ const rhinoModel = { const command = (process.platform === "win32") ? "npx.cmd" : "npx"; -child_process.fork("http-server", ["-a", "localhost", "-p", "5000"], { - execPath: command, +child_process.execSync(`${command} http-server -a localhost -p 5000`, { + shell: true, + stdio: 'inherit' });