Skip to content

Commit

Permalink
xpu web utils
Browse files Browse the repository at this point in the history
  • Loading branch information
ksyeo1010 committed Dec 19, 2023
1 parent 0341a5a commit 2f52d41
Show file tree
Hide file tree
Showing 17 changed files with 477 additions and 291 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules
dist
.idea
lib/build
lib/cmake-build-debug
lib/**/build
lib/**/cmake-build-debug
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added lib/xpu-helper/pv_xpu_helper.wasm
Binary file not shown.
Binary file added lib/xpu-helper/pv_xpu_helper_simd.wasm
Binary file not shown.
9 changes: 9 additions & 0 deletions module.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
declare module 'web-worker:*' {
const WorkerFactory: new () => Worker;
export default WorkerFactory;
}

declare module "*.wasm" {
const content: string;
export default content;
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@picovoice/web-utils",
"version": "1.3.2",
"version": "1.4.0",
"description": "Picovoice web utility functions",
"author": "Picovoice",
"license": "Apache-2.0",
Expand All @@ -15,7 +15,7 @@
"lint": "eslint . --ext .js,.ts",
"prepack": "npm-run-all build",
"start": "cross-env TARGET='debug' rollup --config --watch",
"setup-test": "cmake -DCMAKE_BUILD_TYPE=Release -S lib -B lib/build && cmake --build lib/build",
"setup-test": "cmake -DCMAKE_BUILD_TYPE=Release -S lib/web-utils -B lib/web-utils/build && cmake --build lib/web-utils/build",
"test": "cypress run --browser chrome",
"watch": "rollup --config --watch"
},
Expand Down
4 changes: 4 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const pkg = require('./package.json');
const { babel } = require('@rollup/plugin-babel');
const terser = require('@rollup/plugin-terser');
const { DEFAULT_EXTENSIONS } = require('@babel/core');
const base64 = require('./plugins/base64');

const extensions = [...DEFAULT_EXTENSIONS, '.ts'];

Expand Down Expand Up @@ -67,5 +68,8 @@ export default {
babelHelpers: 'runtime',
exclude: '**/node_modules/**',
}),
base64({
include: ['./lib/**/*.wasm'],
})
],
};
Loading

0 comments on commit 2f52d41

Please sign in to comment.