mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-04 12:13:27 +00:00
init monorepo
This commit is contained in:
parent
4a19b71efc
commit
5adb888926
38
.TODO
38
.TODO
|
@ -1,38 +0,0 @@
|
|||
# SpaceDrive development log / todo list
|
||||
✔ Configured a Tauri window
|
||||
✔ Primative UI components (Button, Input, Shortcut etc)
|
||||
✔ Connect & create sqlite database in application data folder
|
||||
✔ Auto migrate database on app launch
|
||||
✔ Define data schema in Rust
|
||||
✔ Scan given directory recursively and write to database
|
||||
✔ App frame and router set up
|
||||
✔ Render basic file list with database data
|
||||
✔ Create a global store
|
||||
☐ File inspector <- CURRENT
|
||||
✔ Virtualized list for explorer @done(21-10-24 04:03)
|
||||
Also cache folder contents and serve lazy, updating in background
|
||||
✔ Native file type icons @done(21-10-24 04:04)
|
||||
✔ Cache native icons in app data folder @done(21-10-24 11:30)
|
||||
☐ Native file previews
|
||||
☐ Generate buffer hash
|
||||
☐ Action system & command pallete
|
||||
☐ Settings screen
|
||||
☐ Tag creation and assignment
|
||||
☐ Job queue system
|
||||
☐ Right click menu
|
||||
☐ Volume identification
|
||||
☐ Set up Tauri updater
|
||||
☐ Statistic calucations
|
||||
Folder size, Volume size, Total capacity, Total unique etc..
|
||||
☐ Onboarding flow
|
||||
☐ Explorer grid view
|
||||
☐ Explorer path viewer / editor
|
||||
☐ File encryptor
|
||||
☐ File viewer / player
|
||||
☐ Secret keystore
|
||||
☐ Search
|
||||
Efficient way to search sqlite: make file table WITHOUT ROWID
|
||||
☐ Open with
|
||||
|
||||
☐ Changelog
|
||||
☐ Landing page
|
60
.gitignore
vendored
60
.gitignore
vendored
|
@ -1,5 +1,61 @@
|
|||
node_modules
|
||||
src-tauri/target
|
||||
.next
|
||||
dist
|
||||
*.tsbuildinfo
|
||||
package-lock.json
|
||||
.eslintcache
|
||||
.turbo
|
||||
.vercel
|
||||
cli/turbo
|
||||
cli/turbo-new
|
||||
cli/turbo-new.exe
|
||||
cli/turbo.exe
|
||||
.DS_Store
|
||||
cache
|
||||
.env
|
||||
vendor/
|
||||
dist
|
||||
data
|
||||
node_modules
|
||||
packages/turbo-server/data/
|
||||
packages/turbo-server/uploads/
|
||||
packages/*/node_modules
|
||||
packages/*/data
|
||||
apps/*/data
|
||||
docs/public/*.st
|
||||
docs/public/*.toml
|
||||
|
||||
.DS_Store
|
||||
!cli/cmd/turbo
|
||||
cli/npm/turbo-android-arm64/bin
|
||||
cli/npm/turbo-darwin-64/bin
|
||||
cli/npm/turbo-darwin-arm64/bin
|
||||
cli/npm/turbo-freebsd-64/bin
|
||||
cli/npm/turbo-freebsd-arm64/bin
|
||||
cli/npm/turbo-linux-32/bin
|
||||
cli/npm/turbo-linux-64/bin
|
||||
cli/npm/turbo-linux-arm/bin
|
||||
cli/npm/turbo-linux-arm64/bin
|
||||
cli/npm/turbo-linux-s390x/bin
|
||||
cli/npm/turbo-linux-mips64le/bin
|
||||
cli/npm/turbo-linux-ppc64le/bin
|
||||
cli/npm/turbo-netbsd-64/bin
|
||||
cli/npm/turbo-openbsd-64/bin
|
||||
cli/npm/turbo-sunos-64/bin
|
||||
cli/npm/turbo-windows-32/turbo.exe
|
||||
cli/npm/turbo-windows-64/turbo.exe
|
||||
cli/npm/turbo-windows-arm64/turbo.exe
|
||||
cli/scripts/turbo-*
|
||||
!/npm/turbo-windows-32/bin
|
||||
!/npm/turbo-windows-64/bin
|
||||
!/npm/turbo-install/bin
|
||||
!cli/internal/cache
|
||||
demo
|
||||
yalc.lock
|
||||
store
|
||||
!http_cache/cache
|
||||
!http_cache/cache/cache.go
|
||||
*.log
|
||||
.npmrc
|
||||
!create-turbo/templates/**/*
|
||||
todos.md
|
||||
examples/*/*.lock
|
11
.prettierrc
11
.prettierrc
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"useTabs": false,
|
||||
"printWidth": 100,
|
||||
"tabWidth": 2,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"jsxBracketSameLine": false,
|
||||
"semi": true,
|
||||
"quoteProps": "consistent"
|
||||
}
|
||||
|
9
.vscode/settings.json
vendored
9
.vscode/settings.json
vendored
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"cSpell.words": ["ipfs", "repr", "tailwindcss"],
|
||||
"rust-analyzer.procMacro.enable": true,
|
||||
"rust-analyzer.diagnostics.enableExperimental": false,
|
||||
}
|
||||
"cSpell.words": ["ipfs", "repr", "tailwindcss"],
|
||||
"rust-analyzer.procMacro.enable": true,
|
||||
"rust-analyzer.diagnostics.enableExperimental": false,
|
||||
}
|
||||
|
78
README.md
Normal file
78
README.md
Normal file
|
@ -0,0 +1,78 @@
|
|||
# Turborepo starter
|
||||
|
||||
This is an official Yarn v1 starter turborepo.
|
||||
|
||||
## What's inside?
|
||||
|
||||
This turborepo uses [Yarn](https://classic.yarnpkg.com/lang/en/) as a package manager. It includes the following packages/apps:
|
||||
|
||||
### Apps and Packages
|
||||
|
||||
- `docs`: a [Next.js](https://nextjs.org) app
|
||||
- `web`: another [Next.js](https://nextjs.org) app
|
||||
- `ui`: a stub React component library shared by both `web` and `docs` applications
|
||||
- `config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
|
||||
- `tsconfig`: `tsconfig.json`s used throughout the monorepo
|
||||
|
||||
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
|
||||
|
||||
### Utilities
|
||||
|
||||
This turborepo has some additional tools already setup for you:
|
||||
|
||||
- [TypeScript](https://www.typescriptlang.org/) for static type checking
|
||||
- [ESLint](https://eslint.org/) for code linting
|
||||
- [Jest](https://jestjs.io) test runner for all things JavaScript
|
||||
- [Prettier](https://prettier.io) for code formatting
|
||||
|
||||
## Setup
|
||||
|
||||
This repository is used in the `npx create-turbo` command, and selected when choosing which package manager you wish to use with your monorepo (Yarn).
|
||||
|
||||
### Build
|
||||
|
||||
To build all apps and packages, run the following command:
|
||||
|
||||
```
|
||||
cd my-turborepo
|
||||
yarn run build
|
||||
```
|
||||
|
||||
### Develop
|
||||
|
||||
To develop all apps and packages, run the following command:
|
||||
|
||||
```
|
||||
cd my-turborepo
|
||||
yarn run dev
|
||||
```
|
||||
|
||||
### Remote Caching
|
||||
|
||||
Turborepo can use a technique known as [Remote Caching (Beta)](https://turborepo.org/docs/features/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
|
||||
|
||||
By default, Turborepo will cache locally. To enable Remote Caching (Beta) you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands:
|
||||
|
||||
```
|
||||
cd my-turborepo
|
||||
npx turbo login
|
||||
```
|
||||
|
||||
This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).
|
||||
|
||||
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your turborepo:
|
||||
|
||||
```
|
||||
npx turbo link
|
||||
```
|
||||
|
||||
## Useful Links
|
||||
|
||||
Learn more about the power of Turborepo:
|
||||
|
||||
- [Pipelines](https://turborepo.org/docs/features/pipelines)
|
||||
- [Caching](https://turborepo.org/docs/features/caching)
|
||||
- [Remote Caching (Beta)](https://turborepo.org/docs/features/remote-caching)
|
||||
- [Scoped Tasks](https://turborepo.org/docs/features/scopes)
|
||||
- [Configuration Options](https://turborepo.org/docs/reference/configuration)
|
||||
- [CLI Usage](https://turborepo.org/docs/reference/command-line-reference)
|
62
apps/desktop/package.json
Normal file
62
apps/desktop/package.json
Normal file
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
"name": "desktop",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "^1.0.0-beta.6",
|
||||
"@types/babel-core": "^6.25.7",
|
||||
"@types/byte-size": "^8.1.0",
|
||||
"@types/react": "^17.0.18",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"@types/react-router-dom": "^5.3.1",
|
||||
"@types/react-virtualized-auto-sizer": "^1.0.1",
|
||||
"@types/react-window": "^1.8.5",
|
||||
"@types/tailwindcss": "^2.2.1",
|
||||
"concurrently": "^6.2.1",
|
||||
"prettier": "^2.3.2",
|
||||
"typescript": "^4.3.5"
|
||||
},
|
||||
"scripts": {
|
||||
"vite": "vite",
|
||||
"dev": "concurrently \"yarn tauri dev\" \"vite\"",
|
||||
"tauri": "tauri",
|
||||
"build": "vite build && tauri build"
|
||||
},
|
||||
"resolutions": {
|
||||
"react-virtualized": "patch:react-virtualized@9.22.3#./path/to/react-virtualized-9.22.3.patch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.4.7",
|
||||
"@headlessui/react": "^1.4.0",
|
||||
"@heroicons/react": "^1.0.4",
|
||||
"@tauri-apps/api": "^1.0.0-beta.5",
|
||||
"@types/pretty-bytes": "^5.2.0",
|
||||
"@types/react-table": "^7.7.6",
|
||||
"@types/react-virtualized": "^9.21.14",
|
||||
"@vitejs/plugin-react-refresh": "^1.3.6",
|
||||
"autoprefixer": "^9",
|
||||
"byte-size": "^8.1.0",
|
||||
"clsx": "^1.1.1",
|
||||
"immer": "^9.0.6",
|
||||
"moment": "^2.29.1",
|
||||
"phosphor-react": "^1.3.1",
|
||||
"pretty-bytes": "^5.6.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-dropzone": "^11.3.4",
|
||||
"react-error-boundary": "^3.1.3",
|
||||
"react-hotkeys-hook": "^3.4.4",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"react-spline": "^1.2.1",
|
||||
"react-virtuoso": "^2.2.6",
|
||||
"rooks": "^5.7.1",
|
||||
"tailwindcss": "^2.2.16",
|
||||
"vite": "^2.4.4",
|
||||
"vite-plugin-filter-replace": "^0.1.9",
|
||||
"vite-tsconfig-paths": "^3.3.13",
|
||||
"zustand": "^3.5.13"
|
||||
}
|
||||
}
|
||||
|
|
@ -3852,8 +3852,7 @@ dependencies = [
|
|||
"snafu",
|
||||
"sqlx",
|
||||
"strum 0.21.0",
|
||||
"swift-rs 0.1.0",
|
||||
"swift-rs 0.2.2",
|
||||
"swift-rs",
|
||||
"tauri",
|
||||
"tauri-build",
|
||||
"walkdir",
|
||||
|
@ -4140,17 +4139,6 @@ dependencies = [
|
|||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "swift-rs"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "429fcb93ca0ca9c60efba60a7f842254781c60d3e006f716c731e9901094c87e"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.81"
|
|
@ -2,7 +2,7 @@ use swift_rs::build_utils::{link_swift, link_swift_package};
|
|||
|
||||
fn main() {
|
||||
link_swift();
|
||||
link_swift_package("swift-lib", "./swift-lib/");
|
||||
link_swift_package("swift-lib", "../../../packages/native-macos/");
|
||||
|
||||
tauri_build::build();
|
||||
}
|
24
apps/desktop/src-tauri/src/commands.rs
Normal file
24
apps/desktop/src-tauri/src/commands.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
use anyhow::Result;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub enum GlobalEventKind {
|
||||
FileTypeThumb,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct GlobalEvent<T> {
|
||||
pub kind: GlobalEventKind,
|
||||
pub data: T,
|
||||
}
|
||||
|
||||
pub fn reply<T: Serialize>(window: &tauri::Window, kind: GlobalEventKind, data: T) {
|
||||
let _message = window
|
||||
.emit("message", GlobalEvent { kind, data })
|
||||
.map_err(|e| println!("{}", e));
|
||||
}
|
||||
|
||||
#[tauri::command(async)]
|
||||
pub async fn scan_dir(window: tauri::Window, path: String) -> Result<(), String> {
|
||||
Ok(())
|
||||
}
|
17
apps/desktop/src-tauri/src/main.rs
Normal file
17
apps/desktop/src-tauri/src/main.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
#![cfg_attr(
|
||||
all(not(debug_assertions), target_os = "windows"),
|
||||
windows_subsystem = "windows"
|
||||
)]
|
||||
mod app;
|
||||
mod commands;
|
||||
use crate::app::menu;
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.setup(|_app| Ok(()))
|
||||
.on_menu_event(|event| menu::handle_menu_event(event))
|
||||
.invoke_handler(tauri::generate_handler![])
|
||||
.menu(menu::get_menu())
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
|
@ -13,12 +13,11 @@
|
|||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"identifier": "co.spacedrive.client",
|
||||
"identifier": "co.spacedrive.desktop",
|
||||
"icon": ["icons/icon.icns"],
|
||||
"resources": [],
|
||||
"externalBin": [],
|
||||
"copyright": "",
|
||||
"category": "DeveloperTool",
|
||||
"copyright": "NerdHouse, Inc",
|
||||
"shortDescription": "",
|
||||
"longDescription": "",
|
||||
"deb": {
|
|
@ -1,11 +1,10 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import App from './App';
|
||||
import './style.css';
|
||||
// import 'style.css';
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
hello
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
);
|
5
apps/desktop/tsconfig.json
Normal file
5
apps/desktop/tsconfig.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"extends": "tsconfig/tauri.json",
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
1
apps/docs/.eslintrc.js
Normal file
1
apps/docs/.eslintrc.js
Normal file
|
@ -0,0 +1 @@
|
|||
module.exports = require("config/eslint-preset");
|
30
apps/docs/README.md
Normal file
30
apps/docs/README.md
Normal file
|
@ -0,0 +1,30 @@
|
|||
## Getting Started
|
||||
|
||||
First, run the development server:
|
||||
|
||||
```bash
|
||||
yarn dev
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
|
||||
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
|
||||
|
||||
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
|
||||
|
||||
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
||||
|
||||
## Deploy on Vercel
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
6
apps/docs/next-env.d.ts
vendored
Normal file
6
apps/docs/next-env.d.ts
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
/// <reference types="next" />
|
||||
/// <reference types="next/types/global" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
5
apps/docs/next.config.js
Normal file
5
apps/docs/next.config.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
const withTM = require("next-transpile-modules")(["ui"]);
|
||||
|
||||
module.exports = withTM({
|
||||
reactStrictMode: true,
|
||||
});
|
25
apps/docs/package.json
Normal file
25
apps/docs/package.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "docs",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --port 3001",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "12.0.3",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"ui": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"config": "*",
|
||||
"eslint": "7.32.0",
|
||||
"next-transpile-modules": "9.0.0",
|
||||
"tsconfig": "*",
|
||||
"@types/react": "17.0.37",
|
||||
"typescript": "^4.5.3"
|
||||
}
|
||||
}
|
10
apps/docs/pages/index.tsx
Normal file
10
apps/docs/pages/index.tsx
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { Button } from "ui";
|
||||
|
||||
export default function Docs() {
|
||||
return (
|
||||
<div>
|
||||
<h1>Docs</h1>
|
||||
<Button />
|
||||
</div>
|
||||
);
|
||||
}
|
5
apps/docs/tsconfig.json
Normal file
5
apps/docs/tsconfig.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"extends": "tsconfig/nextjs.json",
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
7
apps/mobile/package.json
Normal file
7
apps/mobile/package.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"name": "mobile",
|
||||
"version": "0.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
7
apps/server/package.json
Normal file
7
apps/server/package.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"name": "server",
|
||||
"version": "0.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
0
apps/server/server.ts
Normal file
0
apps/server/server.ts
Normal file
1
apps/web/.eslintrc.js
Normal file
1
apps/web/.eslintrc.js
Normal file
|
@ -0,0 +1 @@
|
|||
module.exports = require("config/eslint-preset");
|
30
apps/web/README.md
Normal file
30
apps/web/README.md
Normal file
|
@ -0,0 +1,30 @@
|
|||
## Getting Started
|
||||
|
||||
First, run the development server:
|
||||
|
||||
```bash
|
||||
yarn dev
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
|
||||
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
|
||||
|
||||
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
|
||||
|
||||
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
||||
|
||||
## Deploy on Vercel
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
6
apps/web/next-env.d.ts
vendored
Normal file
6
apps/web/next-env.d.ts
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
/// <reference types="next" />
|
||||
/// <reference types="next/types/global" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
5
apps/web/next.config.js
Normal file
5
apps/web/next.config.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
const withTM = require("next-transpile-modules")(["ui"]);
|
||||
|
||||
module.exports = withTM({
|
||||
reactStrictMode: true,
|
||||
});
|
25
apps/web/package.json
Normal file
25
apps/web/package.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "web",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "12.0.3",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"ui": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"config": "*",
|
||||
"eslint": "7.32.0",
|
||||
"next-transpile-modules": "9.0.0",
|
||||
"tsconfig": "*",
|
||||
"@types/react": "17.0.37",
|
||||
"typescript": "^4.5.3"
|
||||
}
|
||||
}
|
10
apps/web/pages/index.tsx
Normal file
10
apps/web/pages/index.tsx
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { Button } from "ui";
|
||||
|
||||
export default function Web() {
|
||||
return (
|
||||
<div>
|
||||
<h1>Web</h1>
|
||||
<Button />
|
||||
</div>
|
||||
);
|
||||
}
|
5
apps/web/tsconfig.json
Normal file
5
apps/web/tsconfig.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"extends": "tsconfig/nextjs.json",
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
112
package.json
112
package.json
|
@ -1,61 +1,65 @@
|
|||
{
|
||||
"name": "drive",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"name": "spacedrive",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "^1.0.0-beta.6",
|
||||
"@types/babel-core": "^6.25.7",
|
||||
"@types/byte-size": "^8.1.0",
|
||||
"@types/react": "^17.0.18",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"@types/react-router-dom": "^5.3.1",
|
||||
"@types/react-virtualized-auto-sizer": "^1.0.1",
|
||||
"@types/react-window": "^1.8.5",
|
||||
"@types/tailwindcss": "^2.2.1",
|
||||
"concurrently": "^6.2.1",
|
||||
"prettier": "^2.3.2",
|
||||
"typescript": "^4.3.5"
|
||||
"workspaces": {
|
||||
"packages": [
|
||||
"apps/*",
|
||||
"packages/*"
|
||||
],
|
||||
"nohoist": [
|
||||
"**/react-native",
|
||||
"**/react-native/**",
|
||||
"**/@react-native-*",
|
||||
"**/@react-native-*/**",
|
||||
"**/react-native-*",
|
||||
"**/react-native-*/**",
|
||||
"**/expo",
|
||||
"**/expo/**",
|
||||
"**/@expo",
|
||||
"**/@expo/**",
|
||||
"**/expo-*",
|
||||
"**/expo-*/**",
|
||||
"**/metro-*",
|
||||
"**/metro-*/**"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"vite": "vite",
|
||||
"dev": "concurrently \"yarn tauri dev\" \"vite\"",
|
||||
"tauri": "tauri",
|
||||
"build": "vite build && tauri build"
|
||||
"build": "turbo run build",
|
||||
"dev": "turbo run dev --parallel",
|
||||
"lint": "turbo run lint",
|
||||
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
||||
"desktop": "yarn workspace desktop",
|
||||
"mobile": "yarn workspace mobile",
|
||||
"web": "yarn workspace web",
|
||||
"server": "yarn workspace server"
|
||||
},
|
||||
"resolutions": {
|
||||
"react-virtualized": "patch:react-virtualized@9.22.3#./path/to/react-virtualized-9.22.3.patch"
|
||||
|
||||
"devDependencies": {
|
||||
"prettier": "^2.5.1",
|
||||
"turbo": "latest"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.4.7",
|
||||
"@headlessui/react": "^1.4.0",
|
||||
"@heroicons/react": "^1.0.4",
|
||||
"@tauri-apps/api": "^1.0.0-beta.5",
|
||||
"@types/pretty-bytes": "^5.2.0",
|
||||
"@types/react-table": "^7.7.6",
|
||||
"@types/react-virtualized": "^9.21.14",
|
||||
"@vitejs/plugin-react-refresh": "^1.3.6",
|
||||
"autoprefixer": "^9",
|
||||
"byte-size": "^8.1.0",
|
||||
"clsx": "^1.1.1",
|
||||
"immer": "^9.0.6",
|
||||
"moment": "^2.29.1",
|
||||
"phosphor-react": "^1.3.1",
|
||||
"pretty-bytes": "^5.6.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-dropzone": "^11.3.4",
|
||||
"react-error-boundary": "^3.1.3",
|
||||
"react-hotkeys-hook": "^3.4.4",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"react-spline": "^1.2.1",
|
||||
"react-virtuoso": "^2.2.6",
|
||||
"rooks": "^5.7.1",
|
||||
"tailwindcss": "^2.2.16",
|
||||
"vite": "^2.4.4",
|
||||
"vite-plugin-filter-replace": "^0.1.9",
|
||||
"vite-tsconfig-paths": "^3.3.13",
|
||||
"zustand": "^3.5.13"
|
||||
"turbo": {
|
||||
"pipeline": {
|
||||
"build": {
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"outputs": [
|
||||
"dist/**",
|
||||
".next/**"
|
||||
]
|
||||
},
|
||||
"lint": {
|
||||
"outputs": []
|
||||
},
|
||||
"dev": {
|
||||
"cache": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"npm": ">=7.0.0",
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
}
|
||||
}
|
11
packages/config/eslint-preset.js
Normal file
11
packages/config/eslint-preset.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
module.exports = {
|
||||
extends: ["next", "prettier"],
|
||||
settings: {
|
||||
next: {
|
||||
rootDir: ["apps/*/", "packages/*/"],
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
"no-html-link-for-pages": "off",
|
||||
},
|
||||
};
|
13
packages/config/package.json
Normal file
13
packages/config/package.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"name": "config",
|
||||
"version": "0.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"eslint-preset.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"eslint-config-next": "^12.0.3",
|
||||
"eslint-config-prettier": "^8.3.0"
|
||||
}
|
||||
}
|
1
packages/core/.gitignore
vendored
Normal file
1
packages/core/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/target
|
8
packages/core/Cargo.toml
Normal file
8
packages/core/Cargo.toml
Normal file
|
@ -0,0 +1,8 @@
|
|||
[package]
|
||||
name = "rs-core"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
29
packages/core/lib/app/config.rs
Normal file
29
packages/core/lib/app/config.rs
Normal file
|
@ -0,0 +1,29 @@
|
|||
use serde::Serialize;
|
||||
use std::fs;
|
||||
use tauri::api::path;
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct AppConfig {
|
||||
pub primary_db: std::path::PathBuf,
|
||||
pub data_dir: std::path::PathBuf,
|
||||
pub file_type_thumb_dir: std::path::PathBuf,
|
||||
}
|
||||
|
||||
// returns the app config struct with complete values
|
||||
pub fn get_config() -> AppConfig {
|
||||
let app_name = "SpaceDrive";
|
||||
let data_dir = path::data_dir()
|
||||
.unwrap_or(std::path::PathBuf::from("./"))
|
||||
.join(app_name);
|
||||
let file_type_thumb_dir = data_dir.join("file_icons");
|
||||
|
||||
// create the data directory if not exists
|
||||
fs::create_dir_all(&data_dir).unwrap();
|
||||
fs::create_dir_all(&file_type_thumb_dir).unwrap();
|
||||
|
||||
AppConfig {
|
||||
primary_db: data_dir.join("primary.db3"),
|
||||
data_dir,
|
||||
file_type_thumb_dir,
|
||||
}
|
||||
}
|
66
packages/core/lib/app/menu.rs
Normal file
66
packages/core/lib/app/menu.rs
Normal file
|
@ -0,0 +1,66 @@
|
|||
use tauri::{CustomMenuItem, Menu, MenuItem, Submenu, WindowMenuEvent, Wry};
|
||||
|
||||
pub(crate) fn get_menu() -> Menu {
|
||||
// let quit = CustomMenuItem::new("quit".to_string(), "Quit");
|
||||
// let close = CustomMenuItem::new("close".to_string(), "Close");
|
||||
// let jeff = CustomMenuItem::new("jeff".to_string(), "Jeff");
|
||||
// let submenu = Submenu::new(
|
||||
// "File",
|
||||
// Menu::new().add_item(quit).add_item(close).add_item(jeff),
|
||||
// );
|
||||
let spacedrive = Submenu::new(
|
||||
"SpaceDrive",
|
||||
Menu::new()
|
||||
.add_native_item(MenuItem::About("SpaceDrive".to_string()))
|
||||
.add_native_item(MenuItem::Separator)
|
||||
.add_native_item(MenuItem::Services)
|
||||
.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 file = Submenu::new(
|
||||
"File",
|
||||
Menu::new()
|
||||
.add_item(CustomMenuItem::new("quit".to_string(), "Quit"))
|
||||
.add_item(CustomMenuItem::new("close".to_string(), "Close")),
|
||||
);
|
||||
let edit = Submenu::new(
|
||||
"Edit",
|
||||
Menu::new()
|
||||
.add_item(CustomMenuItem::new("jeff".to_string(), "Copy"))
|
||||
.add_item(CustomMenuItem::new("jeffd".to_string(), "Paste")),
|
||||
);
|
||||
let view = Submenu::new(
|
||||
"View",
|
||||
Menu::new()
|
||||
.add_item(CustomMenuItem::new(
|
||||
"command_pallete".to_string(),
|
||||
"Command Pallete",
|
||||
))
|
||||
.add_item(CustomMenuItem::new("jeffd".to_string(), "Layout")),
|
||||
);
|
||||
|
||||
let menu = Menu::new()
|
||||
.add_submenu(spacedrive)
|
||||
.add_submenu(file)
|
||||
.add_submenu(edit)
|
||||
.add_submenu(view);
|
||||
|
||||
menu
|
||||
}
|
||||
|
||||
pub(crate) fn handle_menu_event(event: WindowMenuEvent<Wry>) {
|
||||
match event.menu_item_id() {
|
||||
"quit" => {
|
||||
std::process::exit(0);
|
||||
}
|
||||
"close" => {
|
||||
event.window().close().unwrap();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
2
packages/core/lib/app/mod.rs
Normal file
2
packages/core/lib/app/mod.rs
Normal file
|
@ -0,0 +1,2 @@
|
|||
pub mod config;
|
||||
pub mod menu;
|
0
packages/core/lib/encode/mod.rs
Normal file
0
packages/core/lib/encode/mod.rs
Normal file
13
packages/core/lib/job/type.rs
Normal file
13
packages/core/lib/job/type.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
|
||||
|
||||
pub struct Job {
|
||||
pub id: i32,
|
||||
pub timestamp: i32,
|
||||
pub client_id: i32
|
||||
pub target_client_id: i32,
|
||||
pub file_id: i32,
|
||||
pub action: Action,
|
||||
pub status: String,
|
||||
pub complete: bool,
|
||||
}
|
3
packages/core/lib/main.rs
Normal file
3
packages/core/lib/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
1
packages/core/lib/native/mod.rs
Normal file
1
packages/core/lib/native/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
// This module contains the native bindings to the core library.
|
0
packages/core/lib/secret/keygen.rs
Normal file
0
packages/core/lib/secret/keygen.rs
Normal file
0
packages/core/lib/secret/mod.rs
Normal file
0
packages/core/lib/secret/mod.rs
Normal file
0
packages/core/lib/sync/mod.rs
Normal file
0
packages/core/lib/sync/mod.rs
Normal file
0
packages/core/lib/tx/ingest.rs
Normal file
0
packages/core/lib/tx/ingest.rs
Normal file
0
packages/core/lib/tx/mod.rs
Normal file
0
packages/core/lib/tx/mod.rs
Normal file
0
packages/core/lib/tx/prepare.rs
Normal file
0
packages/core/lib/tx/prepare.rs
Normal file
16
packages/core/lib/tx/type.rs
Normal file
16
packages/core/lib/tx/type.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
|
||||
pub enum TransactionType {
|
||||
CREATE,
|
||||
UPDATE,
|
||||
DELETE,
|
||||
|
||||
}
|
||||
|
||||
pub struct Transaction {
|
||||
pub id: i32,
|
||||
pub timestamp: i32,
|
||||
pub client_id: i32
|
||||
pub target_client_id: i32,
|
||||
type TransactionType
|
||||
}
|
7
packages/core/package.json
Normal file
7
packages/core/package.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"name": "core",
|
||||
"version": "0.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
0
packages/native-android/README.md
Normal file
0
packages/native-android/README.md
Normal file
0
packages/native-ios/README.md
Normal file
0
packages/native-ios/README.md
Normal file
0
packages/native-macos/README.md
Normal file
0
packages/native-macos/README.md
Normal file
0
packages/native-windows/README.md
Normal file
0
packages/native-windows/README.md
Normal file
7
packages/screens/package.json
Normal file
7
packages/screens/package.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"name": "screens",
|
||||
"version": "0.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
1
packages/state/.eslintrc.js
Normal file
1
packages/state/.eslintrc.js
Normal file
|
@ -0,0 +1 @@
|
|||
module.exports = require("scripts/eslint-preset");
|
0
packages/state/.gitignore
vendored
Normal file
0
packages/state/.gitignore
vendored
Normal file
0
packages/state/README.md
Normal file
0
packages/state/README.md
Normal file
0
packages/state/lib/hooks/useFocused.tsx
Normal file
0
packages/state/lib/hooks/useFocused.tsx
Normal file
1
packages/state/lib/index.ts
Normal file
1
packages/state/lib/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export const log = () => {}
|
1
packages/state/lib/stores/datamodel.ts
Normal file
1
packages/state/lib/stores/datamodel.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export const jeff = true;
|
1
packages/state/lib/stores/transaction.ts
Normal file
1
packages/state/lib/stores/transaction.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export const jeff = true;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue