Merge branch 'rewrite'
Co-authored-by: Maze <mazeincoding@users.noreply.github.com>
This commit is contained in:
commit
bab8af831b
|
|
@ -1,5 +1,6 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
dist/
|
dist/
|
||||||
|
target/
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
!.env.example
|
!.env.example
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,5 @@ bun:
|
||||||
# Auto-install deps when lockfile/manifest changes
|
# Auto-install deps when lockfile/manifest changes
|
||||||
installDependencies: true
|
installDependencies: true
|
||||||
|
|
||||||
# Rust toolchain — no crates yet, but enabling it now means
|
# Version is inherited from .prototools (versionFromPrototools)
|
||||||
# moon will automatically understand Cargo.toml files and
|
|
||||||
# track Cargo.lock for hashing when they appear.
|
|
||||||
rust: {}
|
rust: {}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
$schema: 'https://moonrepo.dev/schemas/workspace.json'
|
$schema: 'https://moonrepo.dev/schemas/workspace.json'
|
||||||
|
|
||||||
# Discover all projects under apps/ automatically.
|
# Discover all projects under apps/ automatically.
|
||||||
# When Rust crates land, add a 'crates/*' glob here.
|
# When shared crates land under crates/, add a 'crates/*' glob here.
|
||||||
projects:
|
projects:
|
||||||
- 'apps/*'
|
- 'apps/*'
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,4 @@
|
||||||
# Every developer and CI machine gets the exact same versions automatically.
|
# Every developer and CI machine gets the exact same versions automatically.
|
||||||
moon = "2.3.3"
|
moon = "2.3.3"
|
||||||
bun = "1.3.11"
|
bun = "1.3.11"
|
||||||
|
rust = "1.97.0"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
[workspace]
|
||||||
|
resolver = "3"
|
||||||
|
members = [
|
||||||
|
'apps/desktop',
|
||||||
|
]
|
||||||
|
|
||||||
|
[workspace.package]
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
|
[workspace.dependencies]
|
||||||
|
gpui = "0.2.2"
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
- Headless mode (automation, batch rendering)
|
- Headless mode (automation, batch rendering)
|
||||||
- A scripting tab directly in the editor
|
- A scripting tab directly in the editor
|
||||||
|
|
||||||
You can still find the previous version at [opencut-app/opencut-classic](https://github.com/opencut-app/opencut-classic), which is the one to reach for today. [opencut.app](https://opencut.app) still runs the classic version; the rewrite will live at [new.opencut.app](https://new.opencut.app) until it's ready to take over.
|
You can still find the previous version at [opencut-app/opencut-classic](https://github.com/opencut-app/opencut-classic), which is the one to reach for today. [opencut.app](https://opencut.app) still runs the classic version. The rewrite will live at [new.opencut.app](https://new.opencut.app) until it's ready to take over.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
|
@ -38,13 +38,13 @@ bash <(curl -fsSL https://moonrepo.dev/install/proto.sh)
|
||||||
From the repo root:
|
From the repo root:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
proto use # installs bun + moon at the versions pinned in .prototools
|
proto use # installs the tools pinned in .prototools
|
||||||
bun install
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
moon run web:dev # localhost:5173
|
moon run web:dev # localhost:5173
|
||||||
moon run api:dev # localhost:8787
|
moon run api:dev # localhost:8787
|
||||||
|
moon run desktop:dev # see apps/desktop/README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ tasks:
|
||||||
dev:
|
dev:
|
||||||
command: 'bun run dev'
|
command: 'bun run dev'
|
||||||
options:
|
options:
|
||||||
runInCI: false # dev server — skipped in CI, never cached
|
runInCI: false # dev server: skipped in CI, never cached
|
||||||
|
|
||||||
build:
|
build:
|
||||||
command: 'bun run build'
|
command: 'bun run build'
|
||||||
|
|
|
||||||
|
|
@ -11,5 +11,5 @@ export default new Elysia({ adapter: CloudflareAdapter })
|
||||||
body: t.Object({ message: t.String() }),
|
body: t.Object({ message: t.String() }),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
// .compile() is required — it triggers AoT compilation at startup
|
// .compile() is required, it triggers AoT compilation at startup
|
||||||
.compile();
|
.compile();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
[package]
|
||||||
|
name = "opencut-desktop"
|
||||||
|
description = "OpenCut desktop app, built with GPUI"
|
||||||
|
version.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "opencut-desktop"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
gpui = { workspace = true }
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
# OpenCut Desktop
|
||||||
|
|
||||||
|
Built with [GPUI](https://www.gpui.rs).
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Very early. Right now this is just a window that opens.
|
||||||
|
|
||||||
|
## Running
|
||||||
|
|
||||||
|
Rust is pinned in `.prototools` at the repo root (`proto use` installs it).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
moon run desktop:dev # cargo run
|
||||||
|
moon run desktop:check # cargo check
|
||||||
|
moon run desktop:build # cargo build --release
|
||||||
|
```
|
||||||
|
|
||||||
|
The first build compiles GPUI from source and takes a while. The root `Cargo.lock` is committed.
|
||||||
|
|
||||||
|
## Platform requirements
|
||||||
|
|
||||||
|
- **macOS**: Xcode command line tools (Metal renderer).
|
||||||
|
- **Windows**: no extra dependencies (Win32 + DirectWrite).
|
||||||
|
- **Linux**: renders via Vulkan (Blade), windows via Wayland or X11 (both enabled by default). System packages (Debian/Ubuntu names): `libvulkan1` + working Vulkan drivers, `libwayland-dev`, `libx11-xcb-dev`, `libxkbcommon-x11-dev`, `libfontconfig-dev`, plus a C toolchain and `cmake`.
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
$schema: 'https://moonrepo.dev/schemas/project.json'
|
||||||
|
|
||||||
|
language: 'rust'
|
||||||
|
layer: 'application'
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
dev:
|
||||||
|
command: 'cargo run'
|
||||||
|
options:
|
||||||
|
runInCI: false
|
||||||
|
|
||||||
|
check:
|
||||||
|
command: 'cargo check'
|
||||||
|
inputs:
|
||||||
|
- 'src/**/*'
|
||||||
|
- 'Cargo.toml'
|
||||||
|
- '/Cargo.toml'
|
||||||
|
- '/Cargo.lock'
|
||||||
|
|
||||||
|
build:
|
||||||
|
command: 'cargo build --release'
|
||||||
|
inputs:
|
||||||
|
- 'src/**/*'
|
||||||
|
- 'Cargo.toml'
|
||||||
|
- '/Cargo.toml'
|
||||||
|
- '/Cargo.lock'
|
||||||
|
outputs:
|
||||||
|
- '/target/release/opencut-desktop'
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
use gpui::{
|
||||||
|
div, prelude::*, px, rgb, size, App, Application, Bounds, Context, SharedString,
|
||||||
|
TitlebarOptions, Window, WindowBounds, WindowOptions,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Root {
|
||||||
|
status: SharedString,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Render for Root {
|
||||||
|
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
|
||||||
|
div()
|
||||||
|
.flex()
|
||||||
|
.flex_col()
|
||||||
|
.gap_2()
|
||||||
|
.size_full()
|
||||||
|
.justify_center()
|
||||||
|
.items_center()
|
||||||
|
.bg(rgb(0x111111))
|
||||||
|
.text_color(rgb(0xffffff))
|
||||||
|
.child(div().text_xl().child("OpenCut"))
|
||||||
|
.child(
|
||||||
|
div()
|
||||||
|
.text_sm()
|
||||||
|
.text_color(rgb(0x888888))
|
||||||
|
.child(self.status.clone()),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
Application::new().run(|cx: &mut App| {
|
||||||
|
let bounds = Bounds::centered(None, size(px(960.), px(600.)), cx);
|
||||||
|
cx.open_window(
|
||||||
|
WindowOptions {
|
||||||
|
titlebar: Some(TitlebarOptions {
|
||||||
|
title: Some(SharedString::from("OpenCut")),
|
||||||
|
..Default::default()
|
||||||
|
}),
|
||||||
|
window_bounds: Some(WindowBounds::Windowed(bounds)),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
|_, cx| {
|
||||||
|
cx.new(|_| Root {
|
||||||
|
status: "desktop shell scaffold".into(),
|
||||||
|
})
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.expect("failed to open the main window");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,7 @@ tasks:
|
||||||
dev:
|
dev:
|
||||||
command: 'bun run dev'
|
command: 'bun run dev'
|
||||||
options:
|
options:
|
||||||
runInCI: false # dev server — skipped in CI, never cached
|
runInCI: false # dev server: skipped in CI, never cached
|
||||||
|
|
||||||
build:
|
build:
|
||||||
command: 'bun run build'
|
command: 'bun run build'
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ export const Route = createRootRoute({
|
||||||
content: 'width=device-width, initial-scale=1',
|
content: 'width=device-width, initial-scale=1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'OpenCut rewrite — beta.opencut.app',
|
title: 'OpenCut rewrite | beta.opencut.app',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
links: [
|
links: [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue