fix: use published opencut-wasm package
This commit is contained in:
parent
57fc0fd323
commit
3516bd69f4
|
|
@ -45,10 +45,9 @@ Thank you for your interest in contributing to OpenCut! This document provides g
|
|||
5. Install dependencies: `bun install`
|
||||
6. Start the development server: `bun run dev`
|
||||
|
||||
> **Note:** If you see an error like `Unsupported URL Type "workspace:*"` when running `npm install`, you have two options:
|
||||
> **Note:** Web development uses the published `opencut-wasm` package by default, so a fresh clone does not need a local WASM build.
|
||||
>
|
||||
> 1. Upgrade to a recent npm version (v9 or later), which has full workspace protocol support.
|
||||
> 2. Use an alternative package manager such as **bun** or **pnpm**.
|
||||
> If you are editing `rust/wasm`, run `bun run build:wasm`, then `cd rust/wasm/pkg && bun link`, then `cd ../../../apps/web && bun link opencut-wasm`.
|
||||
|
||||
### Desktop setup
|
||||
|
||||
|
|
|
|||
37
README.md
37
README.md
|
|
@ -93,6 +93,43 @@ Desktop is opt-in. If you're only working on the web app, skip this entirely.
|
|||
|
||||
If you want to get ready for `apps/desktop`, see [`apps/desktop/README.md`](apps/desktop/README.md). It's a two-step setup: Rust toolchain first, then desktop native dependencies.
|
||||
|
||||
### Local WASM development
|
||||
|
||||
Only needed if you're editing `rust/wasm` and want the web app to use your local build instead of the published package.
|
||||
|
||||
1. Build the package once from the repo root:
|
||||
|
||||
```bash
|
||||
bun run build:wasm
|
||||
```
|
||||
|
||||
2. Register the generated package for linking:
|
||||
|
||||
```bash
|
||||
cd rust/wasm/pkg
|
||||
bun link
|
||||
```
|
||||
|
||||
3. Link `apps/web` to the local package:
|
||||
|
||||
```bash
|
||||
cd apps/web
|
||||
bun link opencut-wasm
|
||||
```
|
||||
|
||||
4. Rebuild on changes while you work:
|
||||
|
||||
```bash
|
||||
bun dev:wasm
|
||||
```
|
||||
|
||||
To switch `apps/web` back to the published package, run:
|
||||
|
||||
```bash
|
||||
cd apps/web
|
||||
bun add opencut-wasm
|
||||
```
|
||||
|
||||
### Self-Hosting with Docker
|
||||
|
||||
To run everything (including a production build of the app) in Docker:
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
"@hugeicons/core-free-icons": "^3.1.1",
|
||||
"@hugeicons/react": "^1.1.6",
|
||||
"@huggingface/transformers": "^3.8.1",
|
||||
"opencut-wasm": "workspace:*",
|
||||
"@opennextjs/cloudflare": "^1.18.0",
|
||||
"@radix-ui/react-accordion": "^1.2.12",
|
||||
"@radix-ui/react-checkbox": "^1.3.3",
|
||||
|
|
@ -53,6 +52,7 @@
|
|||
"nanoid": "^5.1.5",
|
||||
"next": "16.1.3",
|
||||
"next-themes": "^0.4.4",
|
||||
"opencut-wasm": "^0.1.2",
|
||||
"pg": "^8.16.2",
|
||||
"postgres": "^3.4.5",
|
||||
"radix-ui": "^1.4.3",
|
||||
|
|
|
|||
8
bun.lock
8
bun.lock
|
|
@ -54,7 +54,7 @@
|
|||
"nanoid": "^5.1.5",
|
||||
"next": "16.1.3",
|
||||
"next-themes": "^0.4.4",
|
||||
"opencut-wasm": "workspace:*",
|
||||
"opencut-wasm": "^0.1.2",
|
||||
"pg": "^8.16.2",
|
||||
"postgres": "^3.4.5",
|
||||
"radix-ui": "^1.4.3",
|
||||
|
|
@ -102,10 +102,6 @@
|
|||
"wrangler": "^4.77.0",
|
||||
},
|
||||
},
|
||||
"rust/wasm/pkg": {
|
||||
"name": "opencut-wasm",
|
||||
"version": "0.1.2",
|
||||
},
|
||||
},
|
||||
"trustedDependencies": [
|
||||
"@tailwindcss/oxide",
|
||||
|
|
@ -1363,7 +1359,7 @@
|
|||
|
||||
"onnxruntime-web": ["onnxruntime-web@1.22.0-dev.20250409-89f8206ba4", "", { "dependencies": { "flatbuffers": "^25.1.24", "guid-typescript": "^1.0.9", "long": "^5.2.3", "onnxruntime-common": "1.22.0-dev.20250409-89f8206ba4", "platform": "^1.3.6", "protobufjs": "^7.2.4" } }, "sha512-0uS76OPgH0hWCPrFKlL8kYVV7ckM7t/36HfbgoFw6Nd0CZVVbQC4PkrR8mBX8LtNUFZO25IQBqV2Hx2ho3FlbQ=="],
|
||||
|
||||
"opencut-wasm": ["opencut-wasm@workspace:rust/wasm/pkg"],
|
||||
"opencut-wasm": ["opencut-wasm@0.1.2", "", {}, "sha512-3OZ7JYwFNFijqQIFBgrqzyD+0V5yG4KPJtRPR76UcqM3Ai3y2GXdp7IlDL7NG3IoQ4C5yX2LzKl2pr4FbDvuFQ=="],
|
||||
|
||||
"p-limit": ["p-limit@6.2.0", "", { "dependencies": { "yocto-queue": "^1.1.1" } }, "sha512-kuUqqHNUqoIWp/c467RI4X6mmyuojY5jGutNU0wVTmEOOfcuwLqyMVoAi9MKi2Ak+5i9+nhmrK4ufZE8069kHA=="],
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
"packageManager": "bun@1.2.18",
|
||||
"workspaces": [
|
||||
"apps/*",
|
||||
"packages/*",
|
||||
"rust/wasm/pkg"
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"build:tools": "turbo run build --filter=@opencut/tools",
|
||||
|
|
|
|||
|
|
@ -19,3 +19,24 @@ All exports are documented in the [TypeScript definitions](./opencut_wasm.d.ts).
|
|||
## Source
|
||||
|
||||
Functions are implemented in Rust under [`rust/crates/`](../crates/). This package is the compiled WebAssembly output — do not edit it directly.
|
||||
|
||||
## Local development
|
||||
|
||||
The web app depends on the published `opencut-wasm` package by default. If you are editing the WASM source in this repo and want `apps/web` to use your local build instead:
|
||||
|
||||
```bash
|
||||
# From the repo root
|
||||
bun run build:wasm
|
||||
|
||||
cd rust/wasm/pkg
|
||||
bun link
|
||||
|
||||
cd ../../../apps/web
|
||||
bun link opencut-wasm
|
||||
```
|
||||
|
||||
While you work, rebuild on changes from the repo root:
|
||||
|
||||
```bash
|
||||
bun dev:wasm
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in New Issue