-
Notifications
You must be signed in to change notification settings - Fork 0
DEV-749 Migration to separate shimmer-web-sdk #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
78
commits into
main
Choose a base branch
from
copilot/restructure-repo-for-api-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
a2aa06a
feat: implement @shimmerresearch/web-ble SDK restructuring (Phase 1-5)
Copilot 9ba2132
chore: tidy-up plan checkpoint
Copilot cfe5973
chore: remove stale legacy files, update all demo imports to SDK dist
Copilot 082e5f3
refactor: move canonical demo sources into demos folder
Copilot 1af2d1a
docs: clarify extension packaging note
Copilot 472ea9e
docs: recommend bundling SDK for extension releases
Copilot d176442
docs: clarify local SDK build path for extension
Copilot 2b880a8
docs: clarify extension README build step
Copilot d7c0ea8
docs: remove redirect demo paths and use demos URLs
Copilot cfaf09c
Update requirements for Verisense devices in README
marknolan 1df9467
Modify Verisense requirements in README
marknolan a6250f4
refactor: move demos to root, point SDK imports to npm CDN, remove lo…
Copilot 09f5064
fix: update shimmer-extension to reference shimmer-web-sdk sibling repo
Copilot d6eb83d
fix: update SDK CDN imports to jsDelivr GitHub source (@latest)
Copilot 0525a2c
docs: rename @shimmerresearch/web-ble to @shimmerresearch/shimmer-web…
Copilot e3753c9
merge: resolve conflicts with main — add spell-gyro demo
Copilot b3d281d
Potential fix for pull request finding
marknolan 03ee3e4
fix: resolve extension SDK path and pin demo SDK version
Copilot 2f22159
Update README with Shimmer3R/Verisense details
marknolan 27c1f7d
Update README.md
marknolan c23523a
Refactored shimmer-ble to shimmer-web-sdk
marknolan e1fa956
shimmer-web-sdk v0.1.4
marknolan 3bfbc52
update to SDK v0.1.6
marknolan e79edf8
Add GitHub Action to auto-format HTML files
Copilot e78557a
Prevent formatter workflow recursion
Copilot ac8dbdc
chore: format HTML files
Copilot 81572ef
Merge base branch and resolve HTML conflicts
Copilot 13522b6
Merge pull request #42 from ShimmerResearch/copilot/implement-html-wo…
marknolan aa53e9e
chore: format HTML files
marknolan 74dcea7
SDK v0.1.7
marknolan a31e830
fix: remove unrecognized 'bluetooth' permission from MV3 manifest
Copilot 1f3bab0
SDK v0.1.7 - all files
marknolan 4c03b58
Merge branch 'copilot/restructure-repo-for-api-support' of https://gi…
marknolan 51195d0
Readme update and build script
marknolan 6e5b2ca
Readme updates and build scripts
marknolan fe0a91e
chore: format HTML files
marknolan 32a9ac0
Readme updates
marknolan 6cd13e5
Merge branch 'copilot/restructure-repo-for-api-support' of https://gi…
marknolan abf7595
DEV-750 #time 2h Verisense SDK updates from design docs
marknolan 13215ec
DEV-750 #time 2h development of VerisenseCapture web app
marknolan d676e0d
chore: format HTML files
marknolan 535adba
DEV-750 #time 15m further GUI refinement
marknolan 9b38857
DEV-750 #time 1m further GUI refinement
marknolan 82a71ce
updated to latest api working code
JongChern fdfd2fa
Merge remote-tracking branch 'origin/main' into copilot/restructure-r…
Copilot 14ee625
chore: format HTML files
Copilot 66f95b1
DEV-750 #time 1h inital DFU support
marknolan 919c53c
DEV-750 #time 1h fully functional DFU
marknolan d3cbaed
Merge branch 'DEV-750_full_verisense_support' of https://github.com/S…
marknolan c5c7bfa
chore: format HTML files
marknolan 245d755
DEV-750 #time 5m minor disconnect button functionality fix
marknolan c09991e
Merge branch 'DEV-750_full_verisense_support' of https://github.com/S…
marknolan beccc5f
chore: format HTML files
marknolan cf0c2d6
DEV-750 #time 1h support for new test report
marknolan d4454ee
Merge branch 'DEV-750_full_verisense_support' of https://github.com/S…
marknolan 2d348d4
chore: format HTML files
marknolan 485360b
DEV-750 op config bytes box
marknolan 55e0e7e
chore: format HTML files
marknolan 63fc1c4
DEV-750 #time 15m improved layout for op config tab
marknolan bb9444d
chore: format HTML files
marknolan c55d317
essage=<DEV-750 move new app to new repo>
marknolan 7c04f64
chore: format HTML files
marknolan d26a342
Merge branch 'copilot/restructure-repo-for-api-support' into DEV-750_…
Copilot 821b922
Merge pull request #43 from ShimmerResearch/DEV-750_full_verisense_su…
marknolan b4d7ec0
Merge main into branch; update migration note to reference v0.0.1 rel…
Copilot 2466674
Code move to SDK. Improved handling of erased device connection.
marknolan b38af62
chore: format HTML files
marknolan 2337cb7
Refactor code structure for improved readability and maintainability
marknolan 44e0f6b
More debugging on USB plugin and handling disabling USB
marknolan 135c0c5
Refactor code structure for improved readability and maintainability
marknolan b8e1541
Refactor code structure for improved readability and maintainability
marknolan 4c78841
Update comments to clarify usage of GEN_CFG_0 bit 2 in Verisense SDK …
marknolan 73893a5
DEV-824: re-vendor shimmer-web-sdk bundle
marknolan 746a978
dependabot library updates and CI improvements for tests
marknolan 421441d
Better handling of disconnect trigger while connection being established
marknolan 62479dd
Re-vendor shimmer-web-sdk bundle (DFU module + domain helpers, SDK PR…
marknolan 25d459e
SDK re-vendor
marknolan 21337a3
DEV-366: re-vendor SDK with LOW_BATT_AUTO_STOP_DISABLED op-config field
marknolan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Format HTML | ||
|
|
||
| on: | ||
| push: | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| format-html: | ||
| if: github.actor != 'github-actions[bot]' | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| PRETTIER_VERSION: 3.3.3 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "20" | ||
|
|
||
| - name: Format HTML files | ||
| run: npx --yes prettier@${{ env.PRETTIER_VERSION }} --write "**/*.html" | ||
|
|
||
| - name: Commit formatted files | ||
| uses: stefanzweifel/git-auto-commit-action@v5 | ||
| with: | ||
| commit_message: "chore: format HTML files" | ||
| file_pattern: "**/*.html" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| // Use IntelliSense to learn about possible attributes. | ||
| // Hover to view descriptions of existing attributes. | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "type": "chrome", | ||
| "request": "launch", | ||
| "name": "Verisense (localhost)", | ||
| "url": "http://localhost:5500/Verisense/index.html", | ||
| "webRoot": "${workspaceFolder}" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,227 @@ | ||
| # webBLEDemos | ||
| This examples are Pre-Alpha Releases, what that implies from a support perspective can be found [here](https://shimmersensing.com/wp-content/uploads/2022/04/Shimmer-Support-Policy_27.04.2022.pdf). If you encounter any technical issues, or would like to express interest in shaping future development, please reach out to our support team. | ||
| If sufficient interest is registered, we may prioritize building a more fully scoped and robust API. | ||
|
|
||
| ## Migration notice | ||
| In the next 4–8 weeks, we plan to migrate to [`shimmer-web-sdk`](https://github.com/ShimmerResearch/shimmer-web-sdk) as a replacement for `shimmer3r.js` and `verisense.js`. | ||
| Migration work has already started on the [`copilot/restructure-repo-for-api-support`](https://github.com/ShimmerResearch/webBLEDemos/tree/copilot/restructure-repo-for-api-support) branch. | ||
| Web Bluetooth demos for Shimmer sensor devices, running entirely in the browser with no native app required. | ||
|
|
||
| # Requirements | ||
| - Shimmer3R | ||
| - FW Version >= v1.0.22 | ||
| > **Migration note** — this branch replaces the local `shimmer3r.js` / `verisense.js` files with the published [`shimmer-web-sdk`](https://github.com/ShimmerResearch/shimmer-web-sdk) package. If you need the pre-migration setup, check out the [v0.0.1](https://github.com/ShimmerResearch/webBLEDemos/releases/tag/v0.0.1) release tag. | ||
|
|
||
| [Gyro Example](https://shimmerresearch.github.io/webBLEDemos/break-gyro/) | ||
| > **Pre-Alpha Release** — these demos and the SDK are early-stage software. What that means from a support perspective is described [here](https://shimmersensing.com/wp-content/uploads/2022/04/Shimmer-Support-Policy_27.04.2022.pdf). If you encounter technical issues, or would like to express interest in shaping future development, please reach out to the Shimmer support team. If sufficient interest is registered, we may prioritise building a more fully scoped and robust API. | ||
|
|
||
| [EMG Example](https://shimmerresearch.github.io/webBLEDemos/break-emg/) | ||
| --- | ||
|
|
||
| [200G Accel Example](https://shimmerresearch.github.io/webBLEDemos/punch-highG/) | ||
| ## Repository Layout | ||
|
|
||
| [EMG+GYRO Example](https://shimmerresearch.github.io/webBLEDemos/rythmgame-emggyro/) | ||
| ``` | ||
| break-gyro/ ┐ | ||
| break-emg/ │ | ||
| punch-highG/ │ | ||
| brick/ │ | ||
| rythmgame-emggyro/ │ Shimmer3R demos | ||
| video-ppg/ │ | ||
| spell-gyro/ │ | ||
| ShimmerCapture/ ┘ | ||
| Verisense/ ← Verisense demo | ||
| shimmer-extension/ ← Shimmer3R/Verisense Chrome extension (source; load unpacked in Chrome) | ||
| sdk-source.json ← Single source-of-truth for SDK source mode/version | ||
| update-local-sdk.ps1 ← Build + sync local SDK artifacts | ||
| sync-local-sdk.ps1 ← Sync-only local SDK artifacts | ||
| update-local-sdk.cmd ← Windows CMD launcher for update script | ||
| ``` | ||
|
|
||
| [PPG Example](https://shimmerresearch.github.io/webBLEDemos/video-ppg/) | ||
| The full Verisense control console now lives in a dedicated repository: | ||
|
|
||
| [Two Gyro Example](https://shimmerresearch.github.io/webBLEDemos/brick/) | ||
| - [ShimmerResearch/verisense-device-console](https://github.com/ShimmerResearch/verisense-device-console) | ||
|
|
||
| [Spell Caster — Gyro Demo](https://shimmerresearch.github.io/webBLEDemos/spell-gyro/) | ||
| --- | ||
|
|
||
| [Shimmer Capture](https://shimmerresearch.github.io/webBLEDemos/ShimmerCapture/) | ||
| ## Live Demos | ||
|
|
||
| [Shimmer3R Chrome Extension](https://github.com/ShimmerEngineering/webBLEDemos/tree/main/shimmer-extension) source code only, will require loading this locally via Chrome | ||
| ### Shimmer3R | ||
| **Requirements:** Shimmer3R device, firmware ≥ v1.0.22, Chrome/Edge (Web Bluetooth required) | ||
|
|
||
| # Requirements | ||
| - Verisense | ||
| | Demo | Link | | ||
| |---|---| | ||
| | Gyro breakout game | [break-gyro](https://shimmerresearch.github.io/webBLEDemos/break-gyro/) | | ||
| | EMG breakout game | [break-emg](https://shimmerresearch.github.io/webBLEDemos/break-emg/) | | ||
| | 200 G accel punch detector | [punch-highG](https://shimmerresearch.github.io/webBLEDemos/punch-highG/) | | ||
| | EMG + Gyro rhythm game | [rythmgame-emggyro](https://shimmerresearch.github.io/webBLEDemos/rythmgame-emggyro/) | | ||
| | PPG heart-rate visualiser | [video-ppg](https://shimmerresearch.github.io/webBLEDemos/video-ppg/) | | ||
| | Two-device gyro brick game | [brick](https://shimmerresearch.github.io/webBLEDemos/brick/) | | ||
| | Spell caster (gyro gestures) | [spell-gyro](https://shimmerresearch.github.io/webBLEDemos/spell-gyro/) | | ||
| | Data capture / CSV download | [ShimmerCapture](https://shimmerresearch.github.io/webBLEDemos/ShimmerCapture/) | | ||
|
|
||
| [Wrist Sensor Example](https://shimmerresearch.github.io/webBLEDemos/Verisense/) | ||
| ### Verisense | ||
| **Requirements:** Verisense device (IMU or Pulse+), Chrome/Edge | ||
|
|
||
| | Demo | Link | | ||
| |---|---| | ||
| | Wrist sensor (accel + GSR streaming) | [Verisense](https://shimmerresearch.github.io/webBLEDemos/Verisense/) | | ||
| | Verisense Device Console (full SDK operations) | [verisense-device-console](https://shimmerresearch.github.io/verisense-device-console/) | | ||
|
|
||
| ### Chrome Extension | ||
| [Shimmer3R Chrome Extension](https://github.com/ShimmerResearch/webBLEDemos/tree/main/shimmer-extension) — source code only; load via **chrome://extensions → Developer mode → Load unpacked** when you are specifically developing or testing extension features. | ||
|
|
||
| This is optional and is **not required** for running the web demos in this repository. | ||
|
|
||
| --- | ||
|
|
||
| ## Local Quickstart | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - Chrome or Edge (Web Bluetooth support required) | ||
| - VS Code with the **Live Server** extension | ||
| - Node.js and npm (required when `sdk-source.json` uses `local-repo`, `local-version`, or `local-latest`) | ||
| - This repo (`webBLEDemos`) checked out next to `shimmer-web-sdk` (required by `update-local-sdk.ps1` / `sync-local-sdk.ps1` unless you pass a custom `-SdkRepoPath`) | ||
|
|
||
| Expected folder layout: | ||
|
|
||
| ```text | ||
| .../shimmer-web-workspace/ | ||
| shimmer-web-sdk/ | ||
| webBLEDemos/ | ||
| ``` | ||
|
|
||
| If your folders are not siblings, use: | ||
|
|
||
| ```powershell | ||
| powershell -ExecutionPolicy Bypass -File .\update-local-sdk.ps1 -SdkRepoPath "C:\path\to\shimmer-web-sdk" | ||
| ``` | ||
|
|
||
| ### SDK source selection (single location) | ||
|
|
||
| Most demos import from `../shimmer-extension/vendor/shimmer-web-sdk.esm.js`. | ||
| The `Verisense` demo imports from `./vendor/shimmer-web-sdk.esm.js`. | ||
| The file that controls where vendor artifacts come from is `sdk-source.json`: | ||
|
|
||
| ```json | ||
| { | ||
| "sourceMode": "local-repo", | ||
| "version": "0.1.7" | ||
| } | ||
| ``` | ||
|
|
||
| Supported `sourceMode` values: | ||
|
|
||
| - `local-repo`: build/sync using the current local `shimmer-web-sdk` checkout | ||
| - `local-version`: build/sync from a specific local SDK git tag using `version` (for example `0.1.7` resolves to `v0.1.7`) | ||
| - `local-latest`: build/sync from the latest local SDK `v*` git tag | ||
|
|
||
| In all modes, demos still import from the same vendored files already in this repo; `sourceMode` only changes which SDK source is used to generate those vendored files before sync. | ||
|
|
||
| How `version` is used: | ||
|
|
||
| - With `local-repo`, `version` is ignored (the current local SDK checkout is used). | ||
| - With `local-version`, `version` is required and selects the SDK tag to build (for example `0.1.7` -> `v0.1.7`). | ||
| - With `local-latest`, `version` is ignored (latest local `v*` tag is used). | ||
|
|
||
| ### 1) Build and sync the local SDK | ||
|
|
||
| If you are using local SDK changes, rebuild and sync the vendored SDK files: | ||
|
|
||
| Script reference: | ||
|
|
||
| | Script | What it does | Typical use | | ||
| |---|---|---| | ||
| | `update-local-sdk.ps1` | Uses `sdk-source.json`; builds SDK only for `local-repo`, then syncs vendor artifacts | Main workflow after SDK/source changes | | ||
| | `sync-local-sdk.ps1` | Uses `sdk-source.json` to sync vendor artifacts only (no build) | You already built SDK elsewhere | | ||
| | `update-local-sdk.cmd` | Windows CMD launcher for `update-local-sdk.ps1` | Double-click or cmd.exe usage | | ||
|
|
||
| ```powershell | ||
| powershell -ExecutionPolicy Bypass -File .\update-local-sdk.ps1 | ||
| ``` | ||
|
|
||
| First run only (installs dependencies before build): | ||
|
|
||
| ```powershell | ||
| powershell -ExecutionPolicy Bypass -File .\update-local-sdk.ps1 -InstallDeps | ||
| ``` | ||
|
|
||
| If Node.js/npm is not installed and you only want to sync already-built vendor artifacts: | ||
|
|
||
| ```powershell | ||
| powershell -ExecutionPolicy Bypass -File .\update-local-sdk.ps1 -SkipBuild | ||
| ``` | ||
|
|
||
| Use a specific SDK version (for example `0.1.7`) from one place: | ||
|
|
||
| 1. Set `"sourceMode": "local-version"` in `sdk-source.json` | ||
| 2. Set `"version": "0.1.7"` in `sdk-source.json` | ||
| 3. Run `powershell -ExecutionPolicy Bypass -File .\update-local-sdk.ps1` | ||
|
|
||
| Switch to latest SDK from one place: | ||
|
|
||
| 1. Set `"sourceMode": "local-latest"` in `sdk-source.json` | ||
| 2. Run `powershell -ExecutionPolicy Bypass -File .\update-local-sdk.ps1` | ||
|
|
||
| Manual equivalent: | ||
|
|
||
| ```powershell | ||
| cd ../shimmer-web-sdk | ||
| powershell -ExecutionPolicy Bypass -File .\build-local-sdk.ps1 | ||
| cd ../webBLEDemos | ||
| powershell -ExecutionPolicy Bypass -File .\sync-local-sdk.ps1 | ||
| ``` | ||
|
|
||
| ### 2) Run a demo on localhost (required for BLE) | ||
|
|
||
| Open a demo file (for example `Verisense/index.html`) in VS Code and choose **Open with Live Server**. | ||
|
|
||
| Use the localhost URL opened by Live Server (commonly `http://localhost:5500/...`). | ||
|
|
||
| ### 3) Connect from the page | ||
|
|
||
| - Click **Connect (BLE)** from the demo page (user gesture is required by the browser). | ||
| - For Verisense, you can also use **Connect USB (Serial)**. | ||
|
|
||
| ### Troubleshooting | ||
|
|
||
| - If BLE buttons do not work, check the URL is `http://localhost/...` or `https://...` (not `file://...`). | ||
| - If a demo fails to import the SDK, run the sync command again from `webBLEDemos` root. | ||
| - If you updated SDK code but behavior did not change, re-run `.\update-local-sdk.ps1` from `webBLEDemos`. | ||
|
|
||
| --- | ||
|
|
||
| ## `@shimmerresearch/shimmer-web-sdk` SDK | ||
|
|
||
| The demos import the SDK from vendored files in this repository, using relative paths that work both on localhost and on GitHub Pages: | ||
|
|
||
| ```js | ||
| import { Shimmer3RClient } from '../shimmer-extension/vendor/shimmer-web-sdk.esm.js'; | ||
| ``` | ||
|
|
||
| This means: | ||
|
|
||
| - Local development uses the vendored SDK file without external CDN dependency. | ||
| - GitHub Pages deployments also resolve the same path under the published `webBLEDemos` site. | ||
| - The demos work on GitHub Pages as long as vendored SDK files are committed with the site. | ||
|
|
||
| For the Verisense demo in this repository: | ||
|
|
||
| ```js | ||
| import { VerisenseBleDevice } from './vendor/shimmer-web-sdk.esm.js'; | ||
| ``` | ||
|
|
||
| ### Update vendored SDK from local source | ||
|
|
||
| When you make SDK changes in the sibling `shimmer-web-sdk` repo, run: | ||
|
|
||
| ```powershell | ||
| powershell -ExecutionPolicy Bypass -File .\update-local-sdk.ps1 | ||
| ``` | ||
|
|
||
| Windows CMD alternative: | ||
|
|
||
| ```cmd | ||
| update-local-sdk.cmd | ||
| ``` | ||
|
|
||
| The sync script uses `sdk-source.json` to copy built artifacts from `shimmer-web-sdk/dist` into both: | ||
|
|
||
| - `webBLEDemos/shimmer-extension/vendor` | ||
| - `webBLEDemos/Verisense/vendor` | ||
|
|
||
| Build logic is centralized in `shimmer-web-sdk/build-local-sdk.ps1` and invoked by `update-local-sdk.ps1`. | ||
|
|
||
| Manual copying into vendor folders is no longer required when you use `update-local-sdk.ps1` or `sync-local-sdk.ps1`. | ||
|
|
||
| The SDK source lives at [ShimmerResearch/shimmer-web-sdk](https://github.com/ShimmerResearch/shimmer-web-sdk). | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.