Skip to content

Commit

Permalink
v0.1.2 🚀
Browse files Browse the repository at this point in the history
- New flat logo
- Added items into Menu bar, making it easier to use
- Opted into universal build from Apple Silicon. meaning, Intel based Mac's can use
- Optimizations and bug fixes
- Less crashes
  • Loading branch information
Rahuletto authored Jun 8, 2024
2 parents 7902cdd + 9ec51a2 commit 87bd500
Show file tree
Hide file tree
Showing 20 changed files with 545 additions and 357 deletions.
61 changes: 57 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

Welcome to Rocket, the super-fast, ultra-efficient, and lightweight code editor that's ready to ship your code to the next level! 🚀

## Soft Landing
Rocket has been made to Public Beta. This is meant to be a fun project but here we are.

### What's new in v0.1.2
- New **flat** logo
- Added items into Menu bar, making it easier to use
- Opted into `universal` build from `Apple Silicon`. meaning, Intel based Mac's can use
- Optimizations and bug fixes
- Less crashes

### TODO
- [ ] Drag and move files and folders
- [ ] Add folders into a folder (sub-directory)
- [ ] Functionality for Copy-Cut-Paste in files and folders
- [ ] Squash Bugs
- [x] Menu bar items
- [x] Universal build
- [x] Reorder opened files
- [x] Resizable Folder View
- [x] Swap positions

## Why Choose Rocket?

### ⚡ Blazing Fast
Expand All @@ -21,7 +42,7 @@ Rocket focuses on giving you the basics without the bloat:
Rocket's interface is modern and sleek, making your coding sessions a visual treat. It’s designed to be easy on the eyes and boost your productivity.

### 🌍 Made for macOS
Rocket is built to work seamlessly on `macOS` with `Apple Silicon`. No fuss, no muss—just smooth coding on your favorite platform.
Rocket is built to work seamlessly on `macOS` with `Apple Silicon` and `Intel`. No fuss, no muss—just smooth coding on your favorite platform.

## The Trade-Offs

Expand All @@ -38,10 +59,42 @@ We love Rocket, but let's be real. it’s not perfect. Here are a few things to

Ready to get started? Here’s how to install Rocket on your Mac:

1. Download the DMG file from [Github](https://github.com/Rahuletto/rocket).
1. Download the DMG file from [Github](https://github.com/Rahuletto/rocket/releases).
2. Open the DMG file and drag Rocket to your Applications folder.
3. Launch Rocket and get ready to code!

<details>
<summary>“Rocket” cannot be opened because the developer cannot be verified.</summary>

### Are you seeing a prompt like this?


<img width="275" alt="image" src="https://github.com/Rahuletto/rocket/assets/71836991/6e44e053-f6b0-435d-b5a2-e6e76fbef3c2">

This is expected as I didn't sign the application using Apple Developer ID
> In short, Apple wants me to pay a fee to remove that prompt + publish to App Store
This will prompt only once after installation. We can override this by opening
- `System Settings` > `Privacy & Security`
- Scroll down


<img width="477" alt="image" src="https://github.com/Rahuletto/rocket/assets/71836991/3714fbaa-20cb-490f-b747-0f00e7681f77">


- Click `Open Anyway`


<img width="277" alt="image" src="https://github.com/Rahuletto/rocket/assets/71836991/0d9a60a7-dfaa-4073-9d7b-971f7d2bfd67">


- Click `Open`, don't worry. This is an open source project. It will not harm your mac or compromise your privacy.


</details>




## Contributing

Expand All @@ -59,12 +112,12 @@ Join our awesome community of developers:
- [GitHub Discussions](https://github.com/Rahuletto/rocket/discussions)
- [Discord Server](https://discord.gg/3JzDV9T5Fn)

If you run into any issues or have questions, reach out on our [support channel](https://rocket.example.com/support).
If you run into any issues or have questions, reach out on our [support channel](https://discord.gg/3JzDV9T5Fn).

## License

Rocket is released under the Attribution-NonCommercial-NoDerivatives License. Check out the [LICENSE](LICENSE) file for more details.

---

Happy coding with Rocket! 🚀
Happy coding with Rocket! 🚀
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rocket",
"private": true,
"version": "0.1.1",
"version": "0.1.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
Binary file modified src-tauri/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "Rocket"
version = "0.1.1"
version = "0.1.2"
description = "A Tauri App"
authors = ["rahuletto"]
license = ""
Expand Down
Binary file removed src-tauri/icons/128x128.png
Binary file not shown.
Binary file modified src-tauri/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src-tauri/icons/512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src-tauri/icons/icon.icns
Binary file not shown.
Binary file modified src-tauri/icons/icon.ico
Binary file not shown.
Binary file modified src-tauri/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions src-tauri/icons/rocket.svg

This file was deleted.

40 changes: 33 additions & 7 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use notify::{Config, RecommendedWatcher, RecursiveMode, Watcher};
use std::sync::mpsc::{channel, Receiver, Sender};
use std::{thread, time::Duration};
use tauri::Manager;
use tauri::AppHandle;
use tauri::{AppHandle, Manager};

mod fs;
mod menu;

static mut FOLDER: String = String::new();

#[tauri::command]
fn open(folder_path: &str) -> String {
Expand Down Expand Up @@ -44,6 +46,10 @@ fn create_folder(dir_path: &str) -> String {

#[tauri::command]
fn watch_changes(dir_path: String, app_handle: AppHandle) {
unsafe {
FOLDER = String::from(dir_path.clone());
}

thread::spawn(move || {
let path = std::path::PathBuf::from(&dir_path);

Expand All @@ -55,18 +61,16 @@ fn watch_changes(dir_path: String, app_handle: AppHandle) {
let mut watcher: RecommendedWatcher = Watcher::new(
tx,
Config::default().with_poll_interval(Duration::from_secs(2)),
).unwrap();

)
.unwrap();

watcher.watch(&path, RecursiveMode::Recursive).unwrap();

loop {
match rx.recv() {
Ok(event) => match event {
Ok(_payload) => {
app_handle
.emit_all("file-changed", "CHANGE")
.unwrap();
app_handle.emit_all("file-changed", "CHANGE").unwrap();
}
Err(e) => println!("Error handling event: {:?}", e),
},
Expand Down Expand Up @@ -98,6 +102,28 @@ fn open_terminal(directory: String) -> String {

fn main() {
tauri::Builder::default()
.menu(menu::menu_bar())
.on_menu_event(|event| match event.menu_item_id() {
"terminal" => unsafe {
open_terminal(FOLDER.clone());
},
"open" => {
event.window().emit("open_dir", String::from("open")).unwrap();
},
"theme" => {
event.window().emit("theme", String::from("theme")).unwrap();
},
"swap" => {
event.window().emit("swap", String::from("swap")).unwrap();
},
"new_file" => {
event.window().emit("new_file", String::from("file")).unwrap();
},
"new_folder" => {
event.window().emit("new_folder", String::from("folder")).unwrap();
},
_ => {}
})
.invoke_handler(tauri::generate_handler![
open,
get_contents,
Expand Down
102 changes: 102 additions & 0 deletions src-tauri/src/menu.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
use tauri::{AboutMetadata, CustomMenuItem, Menu, MenuItem, Submenu};

pub fn menu_bar() -> Menu {
let app_name = "Rocket";
let mut menu = Menu::new();
#[cfg(target_os = "macos")]
{
menu = menu.add_submenu(Submenu::new(
app_name,
Menu::new()
.add_native_item(MenuItem::About(
app_name.to_string(),
AboutMetadata::default(),
))
.add_native_item(MenuItem::Separator)
.add_native_item(MenuItem::Hide)
.add_native_item(MenuItem::HideOthers)
.add_native_item(MenuItem::ShowAll)
.add_native_item(MenuItem::Separator)
.add_native_item(MenuItem::Quit),
));
}

let mut file_menu = Menu::new();
file_menu = file_menu
.add_item(CustomMenuItem::new("new_file".to_string(), "New File"))
.add_item(CustomMenuItem::new("new_folder".to_string(), "New Folder"))
.add_native_item(MenuItem::Separator)
.add_item(CustomMenuItem::new("open".to_string(), "Open Folder"))
.add_native_item(MenuItem::Separator)
.add_item(CustomMenuItem::new("save".to_string(), "Save").accelerator("Command+S"))
.add_item(
CustomMenuItem::new("auto_save".to_string(), "Auto Save")
.selected()
.disabled(),
)
.add_native_item(MenuItem::Separator)
.add_native_item(MenuItem::CloseWindow);

#[cfg(not(target_os = "macos"))]
{
file_menu = file_menu.add_native_item(MenuItem::Quit);
}

menu = menu.add_submenu(Submenu::new("File", file_menu));

#[cfg(not(target_os = "linux"))]
let mut edit_menu = Menu::new();
#[cfg(target_os = "macos")]
{
edit_menu = edit_menu
.add_native_item(MenuItem::Undo)
.add_native_item(MenuItem::Redo)
.add_native_item(MenuItem::Separator);
}
#[cfg(not(target_os = "linux"))]
{
edit_menu = edit_menu
.add_native_item(MenuItem::Cut)
.add_native_item(MenuItem::Copy)
.add_native_item(MenuItem::Paste);
}
#[cfg(target_os = "macos")]
{
edit_menu = edit_menu.add_native_item(MenuItem::SelectAll);
}
#[cfg(not(target_os = "linux"))]
{
menu = menu.add_submenu(Submenu::new("Edit", edit_menu));
}
#[cfg(target_os = "macos")]
{
let mut view_menu = Menu::new();

view_menu = view_menu
.add_item(CustomMenuItem::new("swap".to_string(), "Swap Layout"))
.add_item(CustomMenuItem::new("theme".to_string(), "Change Theme"))
.add_native_item(MenuItem::Separator)
.add_native_item(MenuItem::EnterFullScreen);

menu = menu.add_submenu(Submenu::new("View", view_menu));
}

let mut window_menu = Menu::new();
window_menu = window_menu.add_native_item(MenuItem::Minimize);
#[cfg(target_os = "macos")]
{
window_menu = window_menu.add_native_item(MenuItem::Separator);
}
window_menu = window_menu
.add_native_item(MenuItem::CloseWindow)
.add_native_item(MenuItem::Quit);
menu = menu.add_submenu(Submenu::new("Window", window_menu));

let mut terminal_menu = Menu::new();
terminal_menu =
terminal_menu.add_item(CustomMenuItem::new("terminal".to_string(), "New Terminal"));

menu = menu.add_submenu(Submenu::new("Terminal", terminal_menu));

menu
}
4 changes: 2 additions & 2 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package": {
"productName": "Rocket",
"version": "0.1.1"
"version": "0.1.2"
},
"tauri": {
"macOSPrivateApi": true,
Expand All @@ -24,7 +24,7 @@
"externalBin": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/512x512.png",
"icons/icon.icns",
"icons/icon.ico"
],
Expand Down
Loading

0 comments on commit 87bd500

Please sign in to comment.