Skip to content

Commit

Permalink
remove unused packages
Browse files Browse the repository at this point in the history
sorry edelvarden
  • Loading branch information
0-don committed Dec 10, 2023
1 parent bc5fbc5 commit 8857c79
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 48 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ jobs:
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
echo "description=$(node -p "require('./package.json').description")" >> $GITHUB_OUTPUT
# - uses: dev-drprasad/[email protected]
# with:
# tag_name: ${{ steps.get-package.outputs.version }}
# github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: dev-drprasad/[email protected]
with:
tag_name: ${{ steps.get-package.outputs.version }}
github_token: ${{ secrets.GITHUB_TOKEN }}


build-tauri:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ package-lock.json
pnpm-lock.yaml
target
yarn-error.log

.vscode
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
successor of [the electron clippy](https://github.com/Don-Cryptus/clippy-ts)

### features

- display/hide **ctrl+y** or **ctrl+d** (change in settings)
- type out clipboard **ctrl+b** (where pasting isn't allowed)
- images & text support
Expand All @@ -34,6 +35,28 @@ successor of [the electron clippy](https://github.com/Don-Cryptus/clippy-ts)
- change keyboard bindings
- dark mode / white mode

### Prerequisites

Before you begin, ensure you have met the following requirements:

- [Rust](https://www.rust-lang.org/tools/install)
- [Node.js](https://nodejs.org/en/download/)

### Installation and Running the Application

1. **Install Dependencies:**
First, install the necessary Node.js dependencies:

```bash
npm install
```

2. **Run the Application in Watch Mode:**
To start the Tauri application in watch mode, use:
```bash
npm run d
```

#### note
Tested on Linux(x11), Windows

Tested on Linux(x11), Windows
7 changes: 3 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en" class="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Tauri + Solid + Typescript App</title>
<title>Main</title>
</head>

<body class="overflow-hidden">
<div id="root"></div>
<script src="/src/index.tsx" type="module"></script>
<script src="src/index.tsx" type="module"></script>
</body>
</html>
15 changes: 3 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clippy",
"version": "1.2.1",
"version": "1.2.2",
"description": "Clipboard Manager built with Rust & Typescript",
"license": "MIT",
"type": "module",
Expand All @@ -16,26 +16,17 @@
"icon": "tauri icon",
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,css,scss}": [
"prettier --write --list-different"
]
},
"dependencies": {
"@tauri-apps/api": "^1.5.1",
"dayjs": "^1.11.10",
"solid-icons": "^1.1.0",
"solid-js": "^1.8.7",
"tauri-plugin-autostart-api": "https://github.com/tauri-apps/tauri-plugin-autostart"
"solid-js": "^1.8.7"
},
"devDependencies": {
"@tauri-apps/cli": "^1.5.7",
"@types/node": "^20.10.4",
"autoprefixer": "^10.4.16",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"postcss": "^8.4.32",
"prettier": "^3.1.0",
"prettier": "^3.1.1",
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.5.9",
"tailwindcss": "^3.3.6",
Expand Down
2 changes: 1 addition & 1 deletion pages/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Tauri + Solid + Typescript App</title>
<title>About</title>
</head>
<body>
<div id="root"></div>
Expand Down
4 changes: 2 additions & 2 deletions pages/settings.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en" class="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Tauri + Solid + Typescript App</title>
<title>Settings</title>
</head>
<body>
<div id="root"></div>
Expand Down
18 changes: 10 additions & 8 deletions 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 = "clippy"
version = "1.2.1"
version = "1.2.2"
description = "Clipboard Manager built with Rust & Typescript"
authors = ["Don-Cryptus"]
license = "MIT"
Expand Down
1 change: 0 additions & 1 deletion src-tauri/src/service/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub fn toggle_main_window() {
get_main_window()
.emit("set_global_hotkey_event", false)
.unwrap();
// *HOTKEY_RUNNING.get().unwrap().lock().unwrap() = false;
} else {
printlog!("displaying window");
get_main_window()
Expand Down
11 changes: 10 additions & 1 deletion src-tauri/src/utils/hotkey_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub async fn upsert_hotkeys_in_store() -> Result<(), Box<dyn std::error::Error>>
key: hotkey.key,
hotkey: key,
};
println!("{:?}", hotkey_str.clone());

insert_hotkey_into_store(key_struct);
}

Expand Down Expand Up @@ -208,6 +208,15 @@ pub fn parse_shortcut(ctrl: bool, alt: bool, shift: bool, key: &str) -> String {
}

fn format_key_for_parsing(key: &str) -> String {
if key.len() >= 2 && (key.starts_with('F') || key.starts_with('f')) {
if let Ok(number) = key[1..].parse::<u32>() {
if number >= 1 && number <= 24 {
// Adjust the range if necessary
return key.to_uppercase(); // This is a function key like F1, F2, ..., F24
}
}
}

match key.chars().next().unwrap_or_default() {
'0'..='9' => format!("Digit{}", key), // For digits
'A'..='Z' | 'a'..='z' => format!("Key{}", key.to_uppercase()), // For letters
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "clippy",
"version": "1.2.1"
"version": "1.2.2"
},
"tauri": {
"allowlist": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/app/Clipboards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dayjs.extend(relativeTime);
interface ClipboardsProps {}

export const Clipboards: Component<ClipboardsProps> = ({}) => {
let dbClickTimer: NodeJS.Timeout;
let dbClickTimer: any;

const [scrollToTop, setScrollToTop] = createSignal(false);

Expand Down
6 changes: 0 additions & 6 deletions src/store/SettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { HiSolidCog8Tooth } from "solid-icons/hi";
import { RiDeviceKeyboardFill } from "solid-icons/ri";
import { VsHistory } from "solid-icons/vs";
import { createRoot, createSignal } from "solid-js";
import { disable, enable } from "tauri-plugin-autostart-api";
import { Settings } from "../@types";

type SettingsTabName = "General" | "Backup" | "History" | "Hotkeys";
Expand Down Expand Up @@ -47,11 +46,6 @@ function createSettingsStore() {
const initSettings = async () => {
const settings = await invoke<Settings>("get_settings");
setSettings(settings);

try {
const env = (import.meta as any).env;
env.PROD && settings.startup ? await enable() : await disable();
} catch (_) {}
};

const syncClipboard = () => invoke("sync_clipboard_history") as Promise<void>;
Expand Down

0 comments on commit 8857c79

Please sign in to comment.