Skip to content

Commit

Permalink
fix: compile wasm for tauri and web
Browse files Browse the repository at this point in the history
This should be removed in the future and use wasm
only or the web build
  • Loading branch information
gmallios committed Jul 13, 2024
1 parent 6bc4082 commit 5620328
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions manager-ui/src/WebApp.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/// <reference types="web-bluetooth" />

import React, { useState } from 'react';
import {
generate_soundcore_service_uuids,
getSoundcoreMacPrefixes,
WebBLEDevice
} from '@wasm/manager_wasm';
import { generate_soundcore_service_uuids, getSoundcoreMacPrefixes, WebBLEDevice } from '@wasm/manager_wasm';
import { useWebManagerStore } from '@stores/web/useWebManagerStore';
import { DeviceStateCard } from '@components/DeviceStateCard/deviceStateCard';
import { SoundModeCard } from '@components/SoundModeCard/soundModeCard';
Expand All @@ -25,7 +21,7 @@ export const WebApp: React.FC = () => {
const companyIdentifiers = getSoundcoreMacPrefixes();
try {
const device = await navigator.bluetooth.requestDevice({
filters: companyIdentifiers.map((prefix) => ({
filters: companyIdentifiers.map((prefix: number[]) => ({
manufacturerData: [
{
companyIdentifier: (prefix[1] << 8) | prefix[0]
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "soundcoremanager-tauri",
"private": true,
"scripts": {
"dev": "yarn workspace manager-ui dev",
"dev": "yarn build:wasm && yarn workspace manager-ui dev",
"dev:wasm": "cargo watch -w ./manager-wasm/src -w ./soundcore-lib/src -i .gitignore -i '../manager-ui/wasm/*' -s 'yarn build:wasm && yarn dev'",
"dev:force": "yarn workspace manager-ui dev:force",
"build": "yarn workspace manager-ui build",
"build": "yarn build:wasm && yarn workspace manager-ui build",
"build:wasm": "cross-env RUSTFLAGS=--cfg=web_sys_unstable_apis wasm-pack build ./manager-wasm --out-dir ../manager-ui/wasm --no-pack",
"lint": "yarn workspace manager-ui lint",
"lint:fix": "yarn workspace manager-ui lint:fix",
Expand Down

0 comments on commit 5620328

Please sign in to comment.