remove codegen'd files + update dev docs

This commit is contained in:
Jamie Pine 2022-03-31 18:10:56 -07:00
parent b121f0fed6
commit 6cf3933b80
27 changed files with 27 additions and 28894 deletions

View file

@ -103,13 +103,26 @@ All TypeScript packages are compiled automatically using Turborepo.
- `native-android`: a [Kotlin]() native binary
## Developer Info
## Developer Installation Instructions
This environment uses [Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) and [pnpm](https://pnpm.io/installation). Ensure you have them installed before continuing.
- `$ cargo install prisma-client-rust-cli`
- `$ git clone https://github.com/spacedriveapp/spacedrive`
- `$ cd spacedrive`
- `$ pnpm i`
- `$ pnpm prepare` - This runs all necessary codegen.
- `$ pnpm dev` - You must run this once, to build all required dependencies.
To quickly run only the desktop app after `prepare` you can use:
- `$ pnpm desktop dev`
If you are making changes to any TS packages you must run their respective dev environments too, for example:
- `$ pnpm core dev`
- `$ pnpm ui dev`
Or to run everything specific to desktop app development just run:
- `$ pnpm dev`
If you are having issues ensure you are using the following versions of Rust and Node:
- Rust version: **1.58.1**
- Node version: **17**
Install instructions:
- `$ git clone https://github.com/jamiepine/spacedrive`
- `$ cd spacedrive`
- `$ yarn`
- `$ yarn dev`

4
core/.gitignore vendored
View file

@ -1,3 +1,5 @@
/target
/types
*.db*
*.db*
/bindings
/src/prisma.rs

View file

@ -1,9 +1,9 @@
[package]
name = "sdcore"
version = "0.1.0"
description = "The next gen private virtual filesystem."
authors = ["NerdHouse, Inc.", "Jamie Pine"]
license = ""
description = "A virtual distributed filesystem."
authors = ["Jamie Pine"]
license = "GNU GENERAL PUBLIC LICENSE"
repository = "https://github.com/jamiepine/spacedrive"
edition = "2018"

View file

@ -1,2 +0,0 @@
export type ClientCommand = { key: "FileRead", params: { id: number, } } | { key: "FileDelete", params: { id: number, } } | { key: "LibDelete", params: { id: number, } } | { key: "TagCreate", params: { name: string, color: string, } } | { key: "TagUpdate", params: { name: string, color: string, } } | { key: "TagAssign", params: { file_id: number, tag_id: number, } } | { key: "TagDelete", params: { id: number, } } | { key: "LocCreate", params: { path: string, } } | { key: "LocUpdate", params: { id: number, name: string | null, } } | { key: "LocDelete", params: { id: number, } } | { key: "SysVolumeUnmount", params: { id: number, } } | { key: "GenerateThumbsForLocation", params: { id: number, } };

View file

@ -1,2 +0,0 @@
export type ClientQuery = { key: "ClientGetState" } | { key: "SysGetVolumes" } | { key: "LibGetTags" } | { key: "JobGetRunning" } | { key: "JobGetHistory" } | { key: "SysGetLocation", params: { id: number, } } | { key: "LibGetExplorerDir", params: { path: string, limit: number, } };

View file

@ -1,3 +0,0 @@
import type { LibraryState } from "./LibraryState";
export interface ClientState { client_uuid: string, client_name: string, data_path: string, tcp_port: number, libraries: Array<LibraryState>, current_library_uuid: string, }

View file

@ -1,4 +0,0 @@
import type { ClientQuery } from "./ClientQuery";
import type { CoreResource } from "./CoreResource";
export type CoreEvent = { key: "InvalidateQuery", data: ClientQuery } | { key: "InvalidateQueryDebounced", data: ClientQuery } | { key: "InvalidateResource", data: CoreResource } | { key: "Log", data: { message: string, } } | { key: "DatabaseDisconnected", data: { reason: string | null, } };

View file

@ -1,5 +0,0 @@
import type { File } from "./File";
import type { JobReport } from "./JobReport";
import type { LocationResource } from "./LocationResource";
export type CoreResource = "Client" | "Library" | { Location: LocationResource } | { File: File } | { Job: JobReport } | "Tag";

View file

@ -1,7 +0,0 @@
import type { ClientState } from "./ClientState";
import type { DirectoryWithContents } from "./DirectoryWithContents";
import type { JobReport } from "./JobReport";
import type { LocationResource } from "./LocationResource";
import type { Volume } from "./Volume";
export type CoreResponse = { key: "Success", data: null } | { key: "SysGetVolumes", data: Array<Volume> } | { key: "SysGetLocation", data: LocationResource } | { key: "LibGetExplorerDir", data: DirectoryWithContents } | { key: "ClientGetState", data: ClientState } | { key: "LocCreate", data: LocationResource } | { key: "JobGetRunning", data: Array<JobReport> } | { key: "JobGetHistory", data: Array<JobReport> };

View file

@ -1,3 +0,0 @@
import type { FileResource } from "./FileResource";
export interface Directory { directory: FileResource, contents: Array<FileResource>, }

View file

@ -1,3 +0,0 @@
import type { FilePath } from "./FilePath";
export interface DirectoryWithContents { directory: FilePath, contents: Array<FilePath>, }

View file

@ -1,2 +0,0 @@
export type EncryptionAlgorithm = "None" | "AES128" | "AES192" | "AES256";

View file

@ -1,5 +0,0 @@
import type { EncryptionAlgorithm } from "./EncryptionAlgorithm";
import type { FilePath } from "./FilePath";
import type { FileType } from "./FileType";
export interface File { id: number, partial_checksum: string, checksum: string | null, size_in_bytes: string, encryption: EncryptionAlgorithm, file_type: FileType, date_created: string, date_modified: string, date_indexed: string, ipfs_id: string | null, file_paths: Array<FilePath>, }

View file

@ -1,2 +0,0 @@
export interface FilePath { id: number, is_dir: boolean, location_id: number, materialized_path: string, file_id: number | null, parent_id: number | null, date_indexed: string, permissions: string | null, }

View file

@ -1,3 +0,0 @@
import type { LocationResource } from "./LocationResource";
export interface FileResource { id: bigint, is_dir: boolean, location_id: bigint, stem: string, name: string, extension: string | null, quick_checksum: string | null, full_checksum: string | null, size_in_bytes: string, encryption: bigint, date_created: string, date_modified: string, date_indexed: string, ipfs_id: string | null, location: LocationResource | null, parent_id: bigint | null, }

View file

@ -1,2 +0,0 @@
export type FileType = "Unknown" | "Directory" | "Package" | "Archive" | "Image" | "Video" | "Audio" | "Plaintext" | "Alias";

View file

@ -1,2 +0,0 @@
export type JobAction = "ScanLoc" | "GeneratePreviewMedia";

View file

@ -1,3 +0,0 @@
import type { JobStatus } from "./JobStatus";
export interface JobMetadata { id: bigint, client_id: bigint, date_created: string, date_modified: string, status: JobStatus, task_count: bigint, completed_task_count: bigint, message: string, }

View file

@ -1,3 +0,0 @@
import type { JobStatus } from "./JobStatus";
export interface JobReport { id: string, date_created: string, date_modified: string, status: JobStatus, task_count: number, completed_task_count: number, message: string, seconds_elapsed: string, }

View file

@ -1,4 +0,0 @@
import type { JobAction } from "./JobAction";
import type { JobStatus } from "./JobStatus";
export interface JobResource { id: bigint, client_id: bigint, action: JobAction, status: JobStatus, percentage_complete: bigint, task_count: bigint, message: string, completed_task_count: bigint, date_created: string, date_modified: string, }

View file

@ -1,2 +0,0 @@
export type JobStatus = "Queued" | "Running" | "Completed" | "Canceled" | "Failed";

View file

@ -1,2 +0,0 @@
export interface LibraryState { library_uuid: string, library_path: string, offline: boolean, }

View file

@ -1,2 +0,0 @@
export interface LocationResource { id: number, name: string | null, path: string | null, total_capacity: number | null, available_capacity: number | null, is_removable: boolean, is_ejectable: boolean, is_root_filesystem: boolean, is_online: boolean, date_created: string, }

View file

@ -1,2 +0,0 @@
export interface Volume { name: string, mount_point: string, total_capacity: bigint, available_capacity: bigint, is_removable: boolean, disk_type: string | null, file_system: string | null, is_root_filesystem: boolean, }

View file

@ -4,17 +4,12 @@ export * from './bindings/ClientState';
export * from './bindings/CoreEvent';
export * from './bindings/CoreResource';
export * from './bindings/CoreResponse';
export * from './bindings/Directory';
export * from './bindings/DirectoryWithContents';
export * from './bindings/EncryptionAlgorithm';
export * from './bindings/File';
export * from './bindings/FilePath';
export * from './bindings/FileResource';
export * from './bindings/FileType';
export * from './bindings/JobAction';
export * from './bindings/JobMetadata';
export * from './bindings/JobReport';
export * from './bindings/JobResource';
export * from './bindings/JobStatus';
export * from './bindings/LibraryState';
export * from './bindings/LocationResource';

File diff suppressed because one or more lines are too long

View file

@ -21,8 +21,8 @@
]
},
"scripts": {
"prepare": "pnpm db:gen && pnpm core codegen",
"build": "turbo run build",
"setup": "pnpm i && pnpm db:gen && pnpm dev",
"dev": "turbo run dev --parallel --scope=@sd/desktop --scope=@sd/client --scope=@sd/ui",
"db:migrate": "cd packages/core && prisma migrate dev",
"db:gen": "pnpm core prisma generate",