Repository: tyx-editor/TyX
Pull request #22: feat: add workspace toml and CONTRIBUTING.md
Author: login: Myriad-Dreamin
Created: 2025-05-09T18:01:56Z | Merged: 2025-05-10T06:33:26Z

I record some installation instructions in the CONTRIBUTING.md. I don't understand why tauri is stucked if I change the `dev` script from `"dev": "vite"` to `"dev": "tauri dev"`, so I added `"dev:app": "tauri dev"`, to launch the app in dev mode with one command. I also add a workspace toml to allow create other crates, such as the converter mentioned in #20, used by `src-tauri`.


Diff:
diff --git a/.gitignore b/.gitignore
index ba8c266..03154d9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,10 @@ dist-ssr
 *.sln
 *.sw?
 
+# Generated by Cargo
+# will have compiled files and executables
+/target/
+
 src-tauri/bin
 # Local Netlify folder
 .netlify
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..7d7a86f
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,39 @@
+## Project Structure
+
+This project is structured as a monorepo. The main components are:
+
+```bash
+- tyx
+  ├── src       # The tauri/web frontend
+  ├── src-tauri # The tauri bridge to access the system
+  ├── public    # The static assets for the frontend
+  ├── crates    # The tauri backend components used by `src-tauri`
+  │   └── ...
+  └── scripts   # The scripts used to build and run the app
+```
+
+## Setup
+
+Install bun first, according to the instructions at https://bun.sh/docs/installation.
+
+Then, install the dependencies:
+
+```bash
+bun install
+```
+
+## Developing
+
+To start desktop app in dev mode, either run:
+
+```bash
+bun run dev:app
+```
+
+Or run:
+
+```bash
+bun run tauri dev
+```
+
+<!-- todo: build locally -->
diff --git a/src-tauri/Cargo.lock b/Cargo.lock
similarity index 100%
rename from src-tauri/Cargo.lock
rename to Cargo.lock
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 0000000..4498fc1
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,51 @@
+[workspace.package]
+description = "A Tauri App"
+authors = ["Noam Zaks", "Myriad-Dreamin", "TyX Developers"]
+version = "0.1.0"
+rust-version = "1.85.0"                                     # MSRV
+edition = "2024"
+readme = "README.md"
+license = "MIT"
+homepage = "https://tyx-editor.com/"
+repository = "https://github.com/tyx-editor/TyX"
+
+
+[workspace]
+resolver = "2"
+members = ["src-tauri"]
+
+[profile.release]
+codegen-units = 1 # Reduce number of codegen units to increase optimizations
+opt-level = 3
+panic = "abort"   # Abort on panic
+
+[workspace.dependencies]
+
+[workspace.lints.rustdoc]
+broken_intra_doc_links = "warn"
+
+[workspace.lints.rust]
+missing_docs = "warn"
+
+unexpected_cfgs = { level = "allow", check-cfg = [
+    'cfg(wasm_bindgen_unstable_test_coverage)',
+    'cfg(noop)',
+    'cfg(used_linker)',
+] }
+
+[workspace.lints.clippy]
+uninlined_format_args = "warn"
+missing_safety_doc = "warn"
+undocumented_unsafe_blocks = "warn"
+
+[workspace.metadata.typos.default]
+locale = "en-us"
+
+[workspace.metadata.typos.default.extend-words]
+labelled = "labelled"
+onces = "onces"
+withs = "withs"
+
+[workspace.metadata.typos.files]
+ignore-hidden = false
+extend-exclude = ["/.git", "fixtures"]
diff --git a/bun.lock b/bun.lock
index 9d523cf..0101067 100644
--- a/bun.lock
+++ b/bun.lock
@@ -18,6 +18,7 @@
         "@tauri-apps/plugin-shell": "^2.2.1",
         "@tauri-apps/plugin-updater": "~2.7.1",
         "@tiptap/extension-highlight": "^2.12.0",
+        "@tiptap/extension-link": "^2.12.0",
         "@tiptap/extension-subscript": "^2.12.0",
         "@tiptap/extension-superscript": "^2.12.0",
         "@tiptap/extension-table": "^2.12.0",
@@ -287,7 +288,7 @@
 
     "@tiptap/extension-italic": ["@tiptap/extension-italic@2.12.0", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-JKcXK3LmEsmxNzEq5e06rPUGMRLUxmJ2mYtBY4NlJ6yLM9XMDljtgeTnWT0ySLYmfINSFTkX4S7WIRbpl9l4pw=="],
 
-    "@tiptap/extension-link": ["@tiptap/extension-link@2.11.9", "", { "dependencies": { "linkifyjs": "^4.2.0" }, "peerDependencies": { "@tiptap/core": "^2.7.0", "@tiptap/pm": "^2.7.0" } }, "sha512-gi1UonACmQ/T81QdpIociNEIFPr9h6CKoMxfdZgYRrVWMsZuANuXooSjL8d8OirzWkPHxmbhEMyWjcTAV+HYgw=="],
+    "@tiptap/extension-link": ["@tiptap/extension-link@2.12.0", "", { "dependencies": { "linkifyjs": "^4.2.0" }, "peerDependencies": { "@tiptap/core": "^2.7.0", "@tiptap/pm": "^2.7.0" } }, "sha512-N6f78F2onvcL8FAwFOJexOF02UwGETLjQ7cCguhBe/w7vtx7aX8/f+IlaSGY/pIcWyEQpoC28ciM0+QsrJRr1A=="],
 
     "@tiptap/extension-list-item": ["@tiptap/extension-list-item@2.12.0", "", { "peerDependencies": { "@tiptap/core": "^2.7.0" } }, "sha512-4YwZooC8HP+gPxs6YrkB1ayggyYbgVvJx/rWBT6lKSW2MVVg8QXi1zAcSI3MhIhHmqDysXXFPL8JURlbeGjaFA=="],
 
diff --git a/package.json b/package.json
index b055b5d..5561c51 100644
--- a/package.json
+++ b/package.json
@@ -5,6 +5,7 @@
   "type": "module",
   "scripts": {
     "dev": "vite",
+    "dev:app": "tauri dev",
     "build": "bun run scripts/download.ts && tsc && vite build",
     "preview": "vite preview",
     "tauri": "tauri",
@@ -34,6 +35,7 @@
     "@tiptap/extension-table-row": "^2.12.0",
     "@tiptap/extension-text-align": "^2.12.0",
     "@tiptap/extension-underline": "^2.12.0",
+    "@tiptap/extension-link": "^2.12.0",
     "@tiptap/pm": "^2.12.0",
     "@tiptap/react": "^2.12.0",
     "@tiptap/starter-kit": "^2.12.0",
@@ -55,4 +57,4 @@
   "prettier": {
     "semi": false
   }
-}
+}
\ No newline at end of file
diff --git a/src-tauri/.gitignore b/src-tauri/.gitignore
index b21bd68..d34b582 100644
--- a/src-tauri/.gitignore
+++ b/src-tauri/.gitignore
@@ -1,6 +1,3 @@
-# Generated by Cargo
-# will have compiled files and executables
-/target/
 
 # Generated by Tauri
 # will have schema files for capabilities auto-completion
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index b801675..db3f468 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -1,9 +1,11 @@
 [package]
 name = "tyx"
-version = "0.1.0"
-description = "A Tauri App"
-authors = ["you"]
-edition = "2021"
+version.workspace = true
+description.workspace = true
+authors.workspace = true
+edition.workspace = true
+license.workspace = true
+rust-version.workspace = true
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 


Reviews:
user: login: noamzaks
body: This looks great - thank you! Update me if you want to apply some suggestions before I merge or I can fix them
state: APPROVED
author_association: MEMBER
submitted_at: 2025-05-09T18:11:17Z
user: login: Myriad-Dreamin
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-09T21:03:13Z
user: login: Myriad-Dreamin
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-09T21:03:59Z

Review comments:
diff_hunk: @@ -0,0 +1,51 @@
+[workspace.package]
+description = "A Tauri App"
+authors = ["Noam Zaks", "Myriad-Dreamin"]
path: Cargo.toml
user: login: noamzaks
body: Is it standard to include all contributors or does a "wildcard" such as "TyX Developers" make sense here?

created_at: 2025-05-09T18:05:38Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,51 @@
+[workspace.package]
+description = "A Tauri App"
+authors = ["Noam Zaks", "Myriad-Dreamin"]
+version = "0.1.0"
+rust-version = "1.85.0"                          # MSRV
+edition = "2024"
+readme = "README.md"
+license = "Apache-2.0"
path: Cargo.toml
user: login: noamzaks
body: ```suggestion
license = "MIT"
```
created_at: 2025-05-09T18:06:19Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,39 @@
+## Project Structure
+
+This project is structured as a monorepo. The main components are:
+
+```bash
+- tyx
+  ├── src # The tauri frontend
+  ├── src-tauri # The tauri bridge to access the system
+  ├── public # The static assets for the frontend
+  ├── crates # The tauri backend components used by `src-tauri`
+  │   └── ...
+  └── scripts # The scripts used to build and run the app
+```
+
+## Setup
+
+Install bun first, according to the instructions at https://bun.sh/docs/installation.
+
+Then, install the dependencies:
+
+```bash
+bun install
+```
+
+## Developing
+
+To start the development server, run:
+
+```
+bun run dev:app
path: CONTRIBUTING.md
user: login: noamzaks
body: This seems OK to me, but can also be left as `bun run tauri dev` (or `bun run dev` if checking out the web editor.

Also, it makes sense to document the fact that the backend is selected in `backend/index.ts` currently (kind of a hack), I can do that after merging the PR tho
created_at: 2025-05-09T18:07:54Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,39 @@
+## Project Structure
+
+This project is structured as a monorepo. The main components are:
+
+```bash
+- tyx
+  ├── src # The tauri frontend
+  ├── src-tauri # The tauri bridge to access the system
+  ├── public # The static assets for the frontend
+  ├── crates # The tauri backend components used by `src-tauri`
+  │   └── ...
+  └── scripts # The scripts used to build and run the app
+```
+
+## Setup
+
+Install bun first, according to the instructions at https://bun.sh/docs/installation.
+
+Then, install the dependencies:
+
+```bash
+bun install
+```
+
+## Developing
+
+To start the development server, run:
+
+```
+bun run dev:app
+```
+
+## Building
+
+To build the app for production, run:
+
+```bash
+bun run build
path: CONTRIBUTING.md
user: login: noamzaks
body: For the tauri app this would be `bun run tauri build` but it probably won't succeed locally (it will warn against not signing the app)
created_at: 2025-05-09T18:08:28Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,39 @@
+## Project Structure
+
+This project is structured as a monorepo. The main components are:
+
+```bash
+- tyx
+  ├── src       # The tauri frontend
path: CONTRIBUTING.md
user: login: noamzaks
body: ```suggestion
  ├── src       # The tauri/web frontend
```
created_at: 2025-05-09T18:09:34Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,39 @@
+## Project Structure
+
+This project is structured as a monorepo. The main components are:
+
+```bash
+- tyx
+  ├── src # The tauri frontend
+  ├── src-tauri # The tauri bridge to access the system
+  ├── public # The static assets for the frontend
+  ├── crates # The tauri backend components used by `src-tauri`
+  │   └── ...
+  └── scripts # The scripts used to build and run the app
+```
+
+## Setup
+
+Install bun first, according to the instructions at https://bun.sh/docs/installation.
+
+Then, install the dependencies:
+
+```bash
+bun install
+```
+
+## Developing
+
+To start the development server, run:
+
+```
+bun run dev:app
path: CONTRIBUTING.md
user: login: Myriad-Dreamin
body: I ran `bun run dev` and it only started the vite server. not sure what was going wrong. Usually, we could list all starter commands in the "scripts" in the "package.json", so that people can discover them more easily.
created_at: 2025-05-09T21:03:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,39 @@
+## Project Structure
+
+This project is structured as a monorepo. The main components are:
+
+```bash
+- tyx
+  ├── src # The tauri frontend
+  ├── src-tauri # The tauri bridge to access the system
+  ├── public # The static assets for the frontend
+  ├── crates # The tauri backend components used by `src-tauri`
+  │   └── ...
+  └── scripts # The scripts used to build and run the app
+```
+
+## Setup
+
+Install bun first, according to the instructions at https://bun.sh/docs/installation.
+
+Then, install the dependencies:
+
+```bash
+bun install
+```
+
+## Developing
+
+To start the development server, run:
+
+```
+bun run dev:app
+```
+
+## Building
+
+To build the app for production, run:
+
+```bash
+bun run build
path: CONTRIBUTING.md
user: login: Myriad-Dreamin
body: I ran it, and it didn't succeed actually.
created_at: 2025-05-09T21:03:59Z
author_association: CONTRIBUTOR

PR comments:
user: login: noamzaks
created_at: 2025-05-09T18:16:58Z
body: When running `tauri dev` or `tauri build` it first calls `bun run dev` or `bun run build`, that's why changing `dev` to `tauri dev` breaks stuff
author_association: MEMBER
user: login: Myriad-Dreamin
created_at: 2025-05-09T21:12:51Z
body: I apply most suggestions. Please check it. I apply some of them partially:
- I also add `bun run tauri dev` to "Developing" section.
- I removed the "Building Locally" section and it could be added in future, as an improvement.

author_association: CONTRIBUTOR
user: login: noamzaks
created_at: 2025-05-10T06:33:14Z
body: Great, thanks!
Not sure about the developers section yet, I think it might be best if it's just TyX Developers
author_association: MEMBER