Skip to content

Commit

Permalink
v2.0 react (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
albho authored Nov 25, 2023
1 parent 43ff63f commit 04a2e67
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 19 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/react-codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ jobs:
with:
node-version: lts/*

- name: Build Local Web SDK
run: yarn && yarn copywasm && yarn build
working-directory: binding/web

- name: Build Local React SDK
run: yarn && yarn build
working-directory: binding/react

- name: Pre-build dependencies
run: npm install yarn

Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/react-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ jobs:
- name: Pre-build dependencies
run: npm install yarn

- name: Build Local Web SDK
run: yarn && yarn copywasm && yarn build
working-directory: binding/web

- name: Build Local React SDK
run: yarn && yarn build
working-directory: binding/react

- name: Install dependencies
run: yarn install

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
- name: Pre-build dependencies
run: npm install yarn

- name: Build Local Web SDK
run: yarn && yarn copywasm && yarn build
working-directory: binding/web

- name: Install dependencies
run: yarn install

Expand Down
4 changes: 2 additions & 2 deletions binding/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@picovoice/cheetah-react",
"version": "1.1.0",
"version": "2.0.0",
"description": "React hook for Cheetah Web SDK",
"entry": "src/index.ts",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -36,7 +36,7 @@
"test": "cypress run --component"
},
"dependencies": {
"@picovoice/cheetah-web": "=1.1.15"
"@picovoice/cheetah-web": "=2.0.0"
},
"devDependencies": {
"@babel/core": "^7.21.3",
Expand Down
4 changes: 2 additions & 2 deletions binding/react/src/use_cheetah.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export const useCheetah = (): {
const [isListening, setIsListening] = useState<boolean>(false);
const [error, setError] = useState<Error | null>(null);

const errorCallback = useCallback((e: string) => {
setError(new Error(e));
const errorCallback = useCallback((cheetahError: Error) => {
setError(cheetahError);
}, []);

const transcriptCallback = useCallback(
Expand Down
8 changes: 4 additions & 4 deletions binding/react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1110,10 +1110,10 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@picovoice/cheetah-web@=1.1.15":
version "1.1.15"
resolved "https://registry.npmjs.org/@picovoice/cheetah-web/-/cheetah-web-1.1.15.tgz"
integrity sha512-UMKOPqZopcMX3fLQaD3eDRAcUph/6CuirNxQ1SUlNXSxlWO9pdsfdpikaoZ8gx59vbw6l/c8bSB3OicV9Gl2Sw==
"@picovoice/cheetah-web@=2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@picovoice/cheetah-web/-/cheetah-web-2.0.0.tgz#d4415c25e324726356f979bed3761a94e884198e"
integrity sha512-WqxHUznNS7Rf8XfJCp0m0l+xeYFDSFhzOTg+b2DJn06x1slhpJA4CiK4egiH7FzhHiJtvqjLF0dO14LA8e1Gpg==
dependencies:
"@picovoice/web-utils" "=1.3.1"

Expand Down
4 changes: 2 additions & 2 deletions demo/react/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "cheetah-react-demo",
"version": "1.1.0",
"version": "2.0.0",
"private": true,
"description": "Cheetah React demo (made with Create React App)",
"dependencies": {
"@picovoice/cheetah-react": "~1.1.0",
"@picovoice/cheetah-react": "~2.0.0",
"@picovoice/web-voice-processor": "~4.0.8",
"@types/node": "^18.11.9",
"@types/react": "^18.0.17",
Expand Down
18 changes: 9 additions & 9 deletions demo/react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1608,17 +1608,17 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@picovoice/cheetah-react@~1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@picovoice/cheetah-react/-/cheetah-react-1.1.0.tgz#6be98cb02735c9ab2bd203739c50495f59bf0fd7"
integrity sha512-v1QmQ6th+p7y6DtHGeR3u5AOel9yH6Svsab/zdSfymRNZfDk+H+GrczMRkL17D7pknm7KnB0xrFXu0Df/NX/UA==
"@picovoice/cheetah-react@~2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@picovoice/cheetah-react/-/cheetah-react-2.0.0.tgz#00bdd9377f2d141d07e6a08a9d57183cda7c9090"
integrity sha512-t6x3RVzmeUpm4+r/0+b6VMJhmzSVuoyXgvquU/K4HpM0gsJIfIruZOzTOEDsnVae/rmw61v98spxT9NjorZZ8g==
dependencies:
"@picovoice/cheetah-web" "=1.1.15"
"@picovoice/cheetah-web" "=2.0.0"

"@picovoice/cheetah-web@=1.1.15":
version "1.1.15"
resolved "https://registry.yarnpkg.com/@picovoice/cheetah-web/-/cheetah-web-1.1.15.tgz#9545212be4d59dec6fbbcbaba9f9800b741c8732"
integrity sha512-UMKOPqZopcMX3fLQaD3eDRAcUph/6CuirNxQ1SUlNXSxlWO9pdsfdpikaoZ8gx59vbw6l/c8bSB3OicV9Gl2Sw==
"@picovoice/cheetah-web@=2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@picovoice/cheetah-web/-/cheetah-web-2.0.0.tgz#d4415c25e324726356f979bed3761a94e884198e"
integrity sha512-WqxHUznNS7Rf8XfJCp0m0l+xeYFDSFhzOTg+b2DJn06x1slhpJA4CiK4egiH7FzhHiJtvqjLF0dO14LA8e1Gpg==
dependencies:
"@picovoice/web-utils" "=1.3.1"

Expand Down

0 comments on commit 04a2e67

Please sign in to comment.