diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index 16fa89674..000000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1,20 +0,0 @@
-module.exports = {
- root: true,
- parser: '@typescript-eslint/parser',
- parserOptions: {
- project: [
- 'apps/desktop/tsconfig.json',
- 'apps/web/tsconfig.json',
- 'apps/landing/tsconfig.json',
- 'apps/mobile/tsconfig.json',
- 'packages/client/tsconfig.json',
- 'packages/interface/tsconfig.json',
- 'packages/ui/tsconfig.json'
- ]
- },
- plugins: ['@typescript-eslint'],
- extends: ['standard-with-typescript', 'prettier'],
- rules: {
- '@typescript-eslint/explicit-function-return-type': 'off'
- }
-};
diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml
index f2c039e33..3de8c04df 100644
--- a/.github/workflows/clippy.yml
+++ b/.github/workflows/clippy.yml
@@ -48,10 +48,6 @@ jobs:
working-directory: core
if: steps.cache-prisma.outputs.cache-hit != 'true'
run: cargo run -p prisma-cli --release -- generate
-
- # This is do the proc-macro `tauri::generate_context!()` doesn't panic
- - name: Create fake `dist` folder
- run: mkdir ./apps/desktop/dist
- name: Run Clippy
uses: actions-rs/clippy-check@v1
diff --git a/.gitignore b/.gitignore
index 53da2a22b..500449750 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
node_modules
.next
dist
+!apps/desktop/dist
*.tsbuildinfo
package-lock.json
.eslintcache
@@ -15,7 +16,6 @@ storybook-static/
cache
.env
vendor/
-dist
data
node_modules
packages/turbo-server/data/
@@ -61,4 +61,4 @@ todos.md
examples/*/*.lock
/target
-/sdserver_data
\ No newline at end of file
+/sdserver_data
diff --git a/Cargo.lock b/Cargo.lock
index c143a58ec..d4285c8fe 100644
Binary files a/Cargo.lock and b/Cargo.lock differ
diff --git a/Cargo.toml b/Cargo.toml
index 5b06d38b2..bb526593c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,8 +1,9 @@
[workspace]
members = [
- "apps/desktop/src-tauri",
- "core",
- "core/prisma",
- "core/derive",
- "apps/server"
+ "apps/desktop/src-tauri",
+ "core",
+ "core/prisma",
+ "core/derive",
+ "apps/server",
]
+resolver = "2"
diff --git a/apps/desktop/dist/.gitignore b/apps/desktop/dist/.gitignore
new file mode 100644
index 000000000..c53272268
--- /dev/null
+++ b/apps/desktop/dist/.gitignore
@@ -0,0 +1,5 @@
+# Ignore everything in this directory
+*
+# Except this file
+!.gitignore
+# This is done so that Tauri never complains that '../dist does not exist'
diff --git a/apps/desktop/src/index.tsx b/apps/desktop/src/index.tsx
index 002eb506e..d1f54a364 100644
--- a/apps/desktop/src/index.tsx
+++ b/apps/desktop/src/index.tsx
@@ -29,7 +29,7 @@ function App() {
}
}
- const [platform, setPlatform] = useState('macOS');
+ const [platform, setPlatform] = useState('unknown');
const [focused, setFocused] = useState(true);
useEffect(() => {
diff --git a/apps/landing/.eslintrc.js b/apps/landing/.eslintrc.js
new file mode 100644
index 000000000..ec48f24d4
--- /dev/null
+++ b/apps/landing/.eslintrc.js
@@ -0,0 +1,8 @@
+module.exports = {
+ ...require('@sd/config/eslint-react.js'),
+ parserOptions: {
+ tsconfigRootDir: __dirname,
+ project: './tsconfig.json'
+ },
+ ignorePatterns: ['**/*.js', '**/*.json', 'node_modules', 'public', 'dist']
+};
diff --git a/apps/landing/package.json b/apps/landing/package.json
index 4a5a08e58..0a41ad7a9 100644
--- a/apps/landing/package.json
+++ b/apps/landing/package.json
@@ -6,7 +6,8 @@
"vercel-build": "./vercel/deploy.sh",
"build": "vite build && vite build --ssr && vite-plugin-ssr prerender",
"server": "ts-node ./server",
- "server:prod": "cross-env NODE_ENV=production ts-node ./server"
+ "server:prod": "cross-env NODE_ENV=production ts-node ./server",
+ "lint": "eslint src/**/*.{ts,tsx} && tsc --noEmit"
},
"dependencies": {
"@heroicons/react": "^1.0.6",
@@ -39,6 +40,7 @@
"vite-plugin-ssr": "^0.4.15"
},
"devDependencies": {
+ "@sd/config": "link:../../packages/config",
"@tailwindcss/line-clamp": "^0.4.0",
"@tailwindcss/typography": "^0.5.4",
"@types/prismjs": "^1.26.0",
diff --git a/apps/landing/src/components/AppEmbed.tsx b/apps/landing/src/components/AppEmbed.tsx
index dbd065d78..6073603ed 100644
--- a/apps/landing/src/components/AppEmbed.tsx
+++ b/apps/landing/src/components/AppEmbed.tsx
@@ -1,3 +1,4 @@
+/* eslint-disable react-hooks/exhaustive-deps */
import clsx from 'clsx';
import React, { useEffect, useRef, useState } from 'react';
@@ -87,9 +88,7 @@ const AppEmbed = () => {
/>
)}
- {renderImage && (
-
- )}
+ {renderImage &&
}
diff --git a/apps/landing/src/components/Footer.tsx b/apps/landing/src/components/Footer.tsx
index 2ac443954..a0a74210d 100644
--- a/apps/landing/src/components/Footer.tsx
+++ b/apps/landing/src/components/Footer.tsx
@@ -16,6 +16,7 @@ function FooterLink(props: { children: string | JSX.Element; link: string; blank
href={props.link}
target={props.blank ? '_blank' : ''}
className="text-gray-300 hover:text-white"
+ rel="noreferrer"
>
{props.children}
diff --git a/apps/landing/src/components/NavBar.tsx b/apps/landing/src/components/NavBar.tsx
index 2ac773dc2..3ae318840 100644
--- a/apps/landing/src/components/NavBar.tsx
+++ b/apps/landing/src/components/NavBar.tsx
@@ -15,6 +15,7 @@ function NavLink(props: { link?: string; children: string }) {
href={props.link ?? '#'}
target={props.link?.startsWith('http') ? '_blank' : undefined}
className="p-4 text-gray-300 no-underline transition cursor-pointer hover:text-gray-50"
+ rel="noreferrer"
>
{props.children}
@@ -54,6 +55,7 @@ export default function NavBar() {
setTimeout(onScroll, 0);
getWindow()?.addEventListener('scroll', onScroll);
return () => getWindow()?.removeEventListener('scroll', onScroll);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
@@ -136,10 +138,10 @@ export default function NavBar() {
buttonProps={{ className: '!p-1 ml-[140px]' }}
/>
diff --git a/apps/landing/src/components/TeamMember.tsx b/apps/landing/src/components/TeamMember.tsx
index 3101aac59..3dd5f0724 100644
--- a/apps/landing/src/components/TeamMember.tsx
+++ b/apps/landing/src/components/TeamMember.tsx
@@ -36,7 +36,7 @@ function Link(props: LinkProps) {
{props.children}
diff --git a/apps/landing/src/pages/blog/api.ts b/apps/landing/src/pages/blog/api.ts
index 03778da1e..64b298abf 100644
--- a/apps/landing/src/pages/blog/api.ts
+++ b/apps/landing/src/pages/blog/api.ts
@@ -7,35 +7,35 @@ const ghostURL = import.meta.env.VITE_API_URL;
export const blogEnabled = !!(ghostURL && ghostKey);
export const api = blogEnabled
- ? new GhostContentAPI({
- url: ghostURL,
- key: ghostKey,
- version: 'v4'
- })
- : null;
+ ? new GhostContentAPI({
+ url: ghostURL,
+ key: ghostKey,
+ version: 'v5.0'
+ })
+ : null;
export async function getPosts() {
- if (!api) {
- return [];
- }
- const posts = await api.posts
- .browse({
- include: ['tags', 'authors']
- })
- .catch(() => []);
- return posts;
+ if (!api) {
+ return [];
+ }
+ const posts = await api.posts
+ .browse({
+ include: ['tags', 'authors']
+ })
+ .catch(() => []);
+ return posts;
}
export async function getPost(slug: string) {
- if (!api) {
- return null;
- }
- return await api.posts
- .read(
- { slug },
- {
- include: ['tags', 'authors']
- }
- )
- .catch(() => null);
+ if (!api) {
+ return null;
+ }
+ return await api.posts
+ .read(
+ { slug },
+ {
+ include: ['tags', 'authors']
+ }
+ )
+ .catch(() => null);
}
diff --git a/apps/landing/src/pages/blog/index.page.server.ts b/apps/landing/src/pages/blog/index.page.server.ts
index c92ae28dc..b2962ec40 100644
--- a/apps/landing/src/pages/blog/index.page.server.ts
+++ b/apps/landing/src/pages/blog/index.page.server.ts
@@ -1,22 +1,27 @@
-import { getPosts } from './api';
+import { blogEnabled, getPosts } from './api';
export async function onBeforeRender() {
- const posts = await getPosts();
+ const posts = await getPosts();
- return {
- pageContext: {
- pageProps: {
- posts
- }
- }
- };
+ return {
+ pageContext: {
+ pageProps: {
+ posts
+ }
+ }
+ };
}
export async function prerender() {
- const posts = await getPosts();
+ const posts = await getPosts();
- return {
- url: '/blog',
- pageContext: { pageProps: { posts } }
- };
+ const individualPosts = posts.map((post) => ({
+ url: `/blog/${post.slug}`,
+ pageContext: { pageProps: { post } }
+ }));
+
+ return [...individualPosts, {
+ url: '/blog',
+ pageContext: { pageProps: { posts } }
+ }];
}
diff --git a/apps/landing/src/pages/blog/index.page.tsx b/apps/landing/src/pages/blog/index.page.tsx
index 3a90b23c1..071a11ac7 100644
--- a/apps/landing/src/pages/blog/index.page.tsx
+++ b/apps/landing/src/pages/blog/index.page.tsx
@@ -8,7 +8,7 @@ import { blogEnabled } from './api';
function Page({ posts }: { posts: PostOrPage[] }) {
if (!blogEnabled) {
- let window = getWindow();
+ const window = getWindow();
if (!window) return;
window.location.href = '/blog-not-enabled';
return <>>;
@@ -28,6 +28,7 @@ function Page({ posts }: { posts: PostOrPage[] }) {
{posts.map((post) => {
return (
{
window.location.href = `/blog/${post.slug}`;
}}
@@ -49,9 +50,9 @@ function Page({ posts }: { posts: PostOrPage[] }) {
{new Date(post.published_at ?? '').toLocaleDateString()}
- {post.tags?.map((tag: Tag) => {
- return ;
- })}
+ {post.tags?.map((tag: Tag) => (
+
+ ))}
diff --git a/apps/landing/src/pages/blog/post.page.server.ts b/apps/landing/src/pages/blog/post.page.server.ts
index 25d68151c..73d5a08a2 100644
--- a/apps/landing/src/pages/blog/post.page.server.ts
+++ b/apps/landing/src/pages/blog/post.page.server.ts
@@ -3,22 +3,13 @@ import { PageContextBuiltIn } from 'vite-plugin-ssr';
import { getPost, getPosts } from './api';
export async function onBeforeRender(pageContext: PageContextBuiltIn) {
- const post = await getPost(pageContext.routeParams['slug']);
+ const post = await getPost(pageContext.routeParams['slug']);
- return {
- pageContext: {
- pageProps: {
- post
- }
- }
- };
-}
-
-export async function prerender() {
- const posts = await getPosts();
-
- return posts.map((post) => ({
- url: `/blog/${post.slug}`,
- pageContext: { pageProps: { post } }
- }));
+ return {
+ pageContext: {
+ pageProps: {
+ post
+ }
+ }
+ };
}
diff --git a/apps/landing/src/pages/blog/post.page.tsx b/apps/landing/src/pages/blog/post.page.tsx
index 560377514..150738380 100644
--- a/apps/landing/src/pages/blog/post.page.tsx
+++ b/apps/landing/src/pages/blog/post.page.tsx
@@ -12,10 +12,10 @@ function MarkdownPage({ post }: { post: PostOrPage }) {
Prism.highlightAll();
}, []);
- let description =
+ const description =
post?.excerpt?.length || 0 > 160 ? post?.excerpt?.substring(0, 160) + '...' : post?.excerpt;
- let featured_image =
+ const featured_image =
post?.feature_image ||
'https://raw.githubusercontent.com/spacedriveapp/.github/main/profile/spacedrive_icon.png';
@@ -50,9 +50,9 @@ function MarkdownPage({ post }: { post: PostOrPage }) {
- {post?.tags?.map((tag: Tag) => {
- return ;
- })}
+ {post?.tags?.map((tag: Tag) => (
+
+ ))}
Our Values
What drives us daily.
- {values.map((value) => (
-
+ {values.map((value, index) => (
+
{value.title}
{value.desc}
@@ -132,8 +135,9 @@ function Page() {
We're behind you 100%.
- {perks.map((value) => (
+ {perks.map((value, index) => (
@@ -154,8 +158,11 @@ function Page() {
There are no positions open at this time. Please check back later!
) : (
- positions.map((value) => (
-
+ positions.map((value, index) => (
+
{value.name}
diff --git a/apps/landing/src/pages/index.page.tsx b/apps/landing/src/pages/index.page.tsx
index d4c39fa7f..650e3cc3f 100644
--- a/apps/landing/src/pages/index.page.tsx
+++ b/apps/landing/src/pages/index.page.tsx
@@ -20,7 +20,7 @@ interface SectionProps {
}
function Section(props: SectionProps = { orientation: 'left' }) {
- let info = (
+ const info = (
{props.heading &&
{props.heading} }
{props.description && (
@@ -100,11 +100,13 @@ function Page() {
-
+ {/* Disabled while blog post is not available */}
+ {/* TODO: re-enable */}
+ {/*
*/}
{unsubscribedFromWaitlist && (
Find out more →
diff --git a/apps/landing/src/pages/team.page.tsx b/apps/landing/src/pages/team.page.tsx
index 312599d4c..2b5d822eb 100644
--- a/apps/landing/src/pages/team.page.tsx
+++ b/apps/landing/src/pages/team.page.tsx
@@ -245,7 +245,7 @@ function Page() {
open source contributors
diff --git a/apps/landing/src/renderer/types.ts b/apps/landing/src/renderer/types.ts
index 01633e865..f988b9697 100644
--- a/apps/landing/src/renderer/types.ts
+++ b/apps/landing/src/renderer/types.ts
@@ -1,11 +1,11 @@
-export type PageProps = {}
+export type PageProps = Record;
// The `pageContext` that are available in both on the server-side and browser-side
export type PageContext = {
- Page: (pageProps: PageProps) => React.ReactElement
- pageProps: PageProps
- urlPathname: string
- documentProps?: {
- title?: string
- description?: string
- }
-}
+ Page: (pageProps: PageProps) => React.ReactElement;
+ pageProps: PageProps;
+ urlPathname: string;
+ documentProps?: {
+ title?: string;
+ description?: string;
+ };
+};
diff --git a/apps/landing/src/utils/index.ts b/apps/landing/src/utils/index.ts
index 488b9f2c7..e7f9bafdd 100644
--- a/apps/landing/src/utils/index.ts
+++ b/apps/landing/src/utils/index.ts
@@ -6,9 +6,9 @@ export function getWindow(): (Window & typeof globalThis) | null {
return typeof window !== 'undefined' ? window : null;
}
+// eslint-disable-next-line no-useless-escape
const FILE_NAME_REGEX = /^.*[\\\/]/;
-
/**
* Extracts the file name including its extension from a file path
*/
@@ -19,7 +19,7 @@ export function filename(path: string) {
/**
* Takes the result of `import.meta.globEager` and returns an object
* with the keys being the file names and the values being the imported file.
- *
+ *
* Does not work with directories.
*/
export function resolveFilesGlob(files: Record): Record {
diff --git a/apps/mobile/.eslintignore b/apps/mobile/.eslintignore
deleted file mode 100644
index b85fcb7dd..000000000
--- a/apps/mobile/.eslintignore
+++ /dev/null
@@ -1,4 +0,0 @@
-node_modules/
-android/
-ios/
-.expo
\ No newline at end of file
diff --git a/apps/mobile/.eslintrc.js b/apps/mobile/.eslintrc.js
new file mode 100644
index 000000000..d440a4ae9
--- /dev/null
+++ b/apps/mobile/.eslintrc.js
@@ -0,0 +1,42 @@
+module.exports = {
+ env: {
+ 'react-native/react-native': true
+ },
+ parser: '@typescript-eslint/parser',
+ parserOptions: {
+ ecmaFeatures: {
+ jsx: true
+ },
+ ecmaVersion: 12,
+ sourceType: 'module'
+ },
+ extends: [
+ 'eslint:recommended',
+ 'plugin:react/recommended',
+ 'plugin:react-hooks/recommended',
+ 'plugin:@typescript-eslint/recommended'
+ ],
+ plugins: ['react', 'react-native'],
+ rules: {
+ 'react/display-name': 'off',
+ 'react/prop-types': 'off',
+ 'react/no-unescaped-entities': 'off',
+ 'react/react-in-jsx-scope': 'off',
+ 'react-hooks/rules-of-hooks': 'error',
+ 'react-hooks/exhaustive-deps': 'warn',
+ '@typescript-eslint/no-unused-vars': 'off',
+ '@typescript-eslint/ban-ts-comment': 'off',
+ '@typescript-eslint/no-explicit-any': 'off',
+ '@typescript-eslint/no-var-requires': 'off',
+ '@typescript-eslint/no-non-null-assertion': 'off',
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
+ 'no-control-regex': 'off',
+ 'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs']
+ },
+ ignorePatterns: ['**/*.js', '**/*.json', 'node_modules', 'android', 'ios', '.expo'],
+ settings: {
+ react: {
+ version: 'detect'
+ }
+ }
+};
diff --git a/apps/mobile/.eslintrc.json b/apps/mobile/.eslintrc.json
deleted file mode 100755
index 3c3fc8145..000000000
--- a/apps/mobile/.eslintrc.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "env": {
- "react-native/react-native": true
- },
- "extends": [
- "eslint:recommended",
- "plugin:react/recommended",
- "plugin:react-hooks/recommended",
- "plugin:@typescript-eslint/recommended"
- ],
- "parser": "@typescript-eslint/parser",
- "parserOptions": {
- "ecmaFeatures": {
- "jsx": true
- },
- "ecmaVersion": 12,
- "sourceType": "module"
- },
- "plugins": ["react", "react-native", "react-hooks", "@typescript-eslint"],
- "rules": {
- "react-hooks/rules-of-hooks": "error",
- "react-hooks/exhaustive-deps": "warn",
- "@typescript-eslint/ban-ts-comment": "off",
- "@typescript-eslint/no-explicit-any": "off",
- "@typescript-eslint/no-unused-vars": "off",
- "@typescript-eslint/no-var-requires": "off",
- "@typescript-eslint/no-non-null-assertion": "off",
- "@typescript-eslint/explicit-module-boundary-types": "off",
- "react/display-name": "off",
- "react/prop-types": "off",
- "no-control-regex": "off",
- "no-mixed-spaces-and-tabs": ["warn", "smart-tabs"],
- "react/react-in-jsx-scope": "off",
- // Aggressively disable some rules for React Native.
- "@typescript-eslint/strict-boolean-expressions": "off",
- "@typescript-eslint/consistent-type-definitions": "off",
- "@typescript-eslint/no-floating-promises": "off"
- },
- "settings": {
- "react": {
- "version": "detect" // "detect" automatically picks the version you have installed.
- }
- }
-}
diff --git a/apps/mobile/package.json b/apps/mobile/package.json
index bd510e6c2..9fe4e2594 100644
--- a/apps/mobile/package.json
+++ b/apps/mobile/package.json
@@ -6,7 +6,8 @@
"scripts": {
"dev": "expo start --dev-client",
"android": "expo run:android",
- "ios": "expo run:ios"
+ "ios": "expo run:ios",
+ "lint": "eslint src/**/*.{ts,tsx} && tsc --noEmit"
},
"dependencies": {
"@expo/vector-icons": "^13.0.0",
@@ -47,12 +48,17 @@
"@rnx-kit/metro-resolver-symlinks": "^0.1.21",
"@types/react": "~18.0.15",
"@types/react-native": "~0.69.5",
+ "@typescript-eslint/eslint-plugin": "^5.30.7",
+ "@typescript-eslint/parser": "^5.30.7",
+ "eslint": "^8.21.0",
+ "eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native": "^4.0.0",
"metro-minify-terser": "^0.72.0",
"react-native-svg": "^12.4.3",
- "react-native-svg-transformer": "^1.0.0"
+ "react-native-svg-transformer": "^1.0.0",
+ "typescript": "^4.7.4"
},
"private": true
}
diff --git a/apps/mobile/pnpm-lock.yaml b/apps/mobile/pnpm-lock.yaml
index 6e200d20a..1cf083f98 100644
Binary files a/apps/mobile/pnpm-lock.yaml and b/apps/mobile/pnpm-lock.yaml differ
diff --git a/apps/mobile/src/components/browse/BrowseLocationItem.tsx b/apps/mobile/src/components/browse/BrowseLocationItem.tsx
index 8d0ba86d2..383b50624 100644
--- a/apps/mobile/src/components/browse/BrowseLocationItem.tsx
+++ b/apps/mobile/src/components/browse/BrowseLocationItem.tsx
@@ -11,6 +11,7 @@ interface BrowseLocationItemProps {
const BrowseLocationItem: React.FC = (props) => {
const { folderName, onPress } = props;
+
return (
diff --git a/apps/mobile/src/types/declarations.d.ts b/apps/mobile/src/types/declarations.d.ts
index 9784ae9de..793f67889 100644
--- a/apps/mobile/src/types/declarations.d.ts
+++ b/apps/mobile/src/types/declarations.d.ts
@@ -8,6 +8,7 @@ declare module '*.svg' {
// This declaration is used by useNavigation, Link, ref etc.
declare global {
namespace ReactNavigation {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
interface RootParamList extends RootStackParamList {}
}
}
diff --git a/core/Cargo.toml b/core/Cargo.toml
index 3eddc564e..f199eefdd 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -8,7 +8,8 @@ repository = "https://github.com/spacedriveapp/spacedrive"
edition = "2021"
[features]
-p2p = [] # This feature controlls whether the Spacedrive Core contains the Peer to Peer syncing engine (It isn't required for the hosted core so we can disable it).
+p2p = [
+] # This feature controlls whether the Spacedrive Core contains the Peer to Peer syncing engine (It isn't required for the hosted core so we can disable it).
[dependencies]
hostname = "0.3.1"
@@ -26,8 +27,17 @@ rmp = "^0.8.11"
rmp-serde = "^1.1.0"
# Project dependencies
-prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust.git", branch = "0.6.0", features = ["rspc"] }
-rspc = { version = "0.0.4", features = ["axum", "tauri", "uuid", "chrono", "tracing"] }
+prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust.git", rev = "6a0119bce951c8d956542a59b2f783fc5a591fc7", features = [
+ "rspc",
+ "sqlite-create-many",
+] }
+rspc = { version = "0.0.4", features = [
+ "axum",
+ "tauri",
+ "uuid",
+ "chrono",
+ "tracing",
+] }
walkdir = "^2.3.2"
uuid = { version = "1.1.2", features = ["v4", "serde"] }
sysinfo = "0.23.9"
@@ -42,7 +52,7 @@ webp = "0.2.2"
ffmpeg-next = "5.0.3"
fs_extra = "1.2.0"
tracing = "0.1.35"
-tracing-subscriber = "0.3.14"
+tracing-subscriber = { version = "0.3.14", features = ["env-filter"] }
async-stream = "0.3.3"
once_cell = "1.13.0"
ctor = "0.1.22"
diff --git a/core/prisma/Cargo.toml b/core/prisma/Cargo.toml
index d9b60cd5a..b24c05939 100644
--- a/core/prisma/Cargo.toml
+++ b/core/prisma/Cargo.toml
@@ -4,4 +4,7 @@ version = "0.1.0"
edition = "2021"
[dependencies]
-prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust.git", branch = "0.6.0", features = ["rspc"] }
+prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust.git", rev = "6a0119bce951c8d956542a59b2f783fc5a591fc7", features = [
+ "rspc",
+ "sqlite-create-many",
+] }
diff --git a/core/src/api/files.rs b/core/src/api/files.rs
index bb33d9acd..e8329c6ac 100644
--- a/core/src/api/files.rs
+++ b/core/src/api/files.rs
@@ -26,8 +26,7 @@ pub(crate) fn mount() -> RouterBuilder {
library
.db
.file()
- .find_unique(file::id::equals(args.id))
- .update(vec![file::note::set(args.note)])
+ .update(file::id::equals(args.id), vec![file::note::set(args.note)])
.exec()
.await?;
@@ -54,8 +53,10 @@ pub(crate) fn mount() -> RouterBuilder {
library
.db
.file()
- .find_unique(file::id::equals(args.id))
- .update(vec![file::favorite::set(args.favorite)])
+ .update(
+ file::id::equals(args.id),
+ vec![file::favorite::set(args.favorite)],
+ )
.exec()
.await?;
@@ -82,8 +83,7 @@ pub(crate) fn mount() -> RouterBuilder {
library
.db
.file()
- .find_unique(file::id::equals(id))
- .delete()
+ .delete(file::id::equals(id))
.exec()
.await?;
diff --git a/core/src/api/locations.rs b/core/src/api/locations.rs
index 666afcc48..d690597f5 100644
--- a/core/src/api/locations.rs
+++ b/core/src/api/locations.rs
@@ -133,8 +133,10 @@ pub(crate) fn mount() -> RouterBuilder {
library
.db
.location()
- .find_unique(location::id::equals(args.id))
- .update(vec![location::name::set(args.name)])
+ .update(
+ location::id::equals(args.id),
+ vec![location::name::set(args.name)],
+ )
.exec()
.await?;
@@ -147,16 +149,14 @@ pub(crate) fn mount() -> RouterBuilder {
library
.db
.file_path()
- .find_many(vec![file_path::location_id::equals(Some(location_id))])
- .delete()
+ .delete_many(vec![file_path::location_id::equals(Some(location_id))])
.exec()
.await?;
library
.db
.location()
- .find_unique(location::id::equals(location_id))
- .delete()
+ .delete(location::id::equals(location_id))
.exec()
.await?;
diff --git a/core/src/api/tags.rs b/core/src/api/tags.rs
index c8a75bc9d..b7a7996d5 100644
--- a/core/src/api/tags.rs
+++ b/core/src/api/tags.rs
@@ -97,8 +97,10 @@ pub(crate) fn mount() -> RouterBuilder {
library
.db
.tag()
- .find_unique(tag::id::equals(args.id))
- .update(vec![tag::name::set(args.name), tag::color::set(args.color)])
+ .update(
+ tag::id::equals(args.id),
+ vec![tag::name::set(args.name), tag::color::set(args.color)],
+ )
.exec()
.await?;
@@ -117,13 +119,7 @@ pub(crate) fn mount() -> RouterBuilder {
.mutation("delete", |ctx, arg: LibraryArgs| async move {
let (id, library) = arg.get_library(&ctx).await?;
- library
- .db
- .tag()
- .find_unique(tag::id::equals(id))
- .delete()
- .exec()
- .await?;
+ library.db.tag().delete(tag::id::equals(id)).exec().await?;
invalidate_query!(
library,
diff --git a/core/src/file/cas/identifier.rs b/core/src/file/cas/identifier.rs
index 8cbe5bbcc..ac13c7b92 100644
--- a/core/src/file/cas/identifier.rs
+++ b/core/src/file/cas/identifier.rs
@@ -3,7 +3,7 @@ use super::checksum::generate_cas_id;
use crate::{
job::{JobError, JobReportUpdate, JobResult, JobState, StatefulJob, WorkerContext},
library::LibraryContext,
- prisma::{self, file, file_path, location},
+ prisma::{file, file_path, location},
};
use chrono::{DateTime, FixedOffset};
use prisma_client_rust::{prisma_models::PrismaValue, raw, raw::Raw, Direction};
@@ -160,10 +160,10 @@ impl StatefulJob for FileIdentifierJob {
if let Err(e) = library_ctx
.db
.file_path()
- .find_unique(file_path::id::equals(
- *cas_lookup.get(&existing_file.cas_id).unwrap(),
- ))
- .update(vec![file_path::file_id::set(Some(existing_file.id))])
+ .update(
+ file_path::id::equals(*cas_lookup.get(&existing_file.cas_id).unwrap()),
+ vec![file_path::file_id::set(Some(existing_file.id))],
+ )
.exec()
.await
{
@@ -205,6 +205,7 @@ impl StatefulJob for FileIdentifierJob {
),
values,
))
+ .exec()
.await
.unwrap_or_else(|e| {
error!("Error inserting files: {:#?}", e);
@@ -219,10 +220,10 @@ impl StatefulJob for FileIdentifierJob {
.library_ctx()
.db
.file_path()
- .find_unique(file_path::id::equals(
- *cas_lookup.get(&created_file.cas_id).unwrap(),
- ))
- .update(vec![file_path::file_id::set(Some(created_file.id))])
+ .update(
+ file_path::id::equals(*cas_lookup.get(&created_file.cas_id).unwrap()),
+ vec![file_path::file_id::set(Some(created_file.id))],
+ )
.exec()
.await
{
@@ -277,12 +278,13 @@ struct CountRes {
pub async fn count_orphan_file_paths(
ctx: &LibraryContext,
location_id: i64,
-) -> Result {
+) -> Result {
let files_count = ctx.db
._query_raw::(raw!(
"SELECT COUNT(*) AS count FROM file_paths WHERE file_id IS NULL AND is_dir IS FALSE AND location_id = {}",
PrismaValue::Int(location_id)
))
+ .exec()
.await?;
Ok(files_count[0].count.unwrap_or(0))
}
@@ -290,7 +292,7 @@ pub async fn count_orphan_file_paths(
pub async fn get_orphan_file_paths(
ctx: &LibraryContext,
cursor: i32,
-) -> Result, prisma::QueryError> {
+) -> Result, prisma_client_rust::QueryError> {
info!(
"discovering {} orphan file paths at cursor: {:?}",
CHUNK_SIZE, cursor
@@ -302,7 +304,7 @@ pub async fn get_orphan_file_paths(
file_path::is_dir::equals(false),
])
.order_by(file_path::id::order(Direction::Asc))
- .cursor(file_path::id::cursor(cursor))
+ .cursor(file_path::id::equals(cursor))
.take(CHUNK_SIZE as i64)
.exec()
.await
diff --git a/core/src/file/indexer.rs b/core/src/file/indexer.rs
index b9189b17d..36c75b470 100644
--- a/core/src/file/indexer.rs
+++ b/core/src/file/indexer.rs
@@ -86,6 +86,7 @@ impl StatefulJob for IndexerJob {
.library_ctx()
.db
._query_raw::(raw!("SELECT MAX(id) id FROM file_paths"))
+ .exec()
.await
{
Ok(rows) => rows[0].id.unwrap_or(0),
@@ -241,7 +242,7 @@ impl StatefulJob for IndexerJob {
files
);
- let count = ctx.library_ctx().db._execute_raw(raw).await;
+ let count = ctx.library_ctx().db._execute_raw(raw).exec().await;
info!("Inserted {:?} records", count);
diff --git a/core/src/job/job_manager.rs b/core/src/job/job_manager.rs
index 140b1ddf2..f79996579 100644
--- a/core/src/job/job_manager.rs
+++ b/core/src/job/job_manager.rs
@@ -6,7 +6,7 @@ use crate::{
},
job::{worker::Worker, DynJob, Job, JobError},
library::LibraryContext,
- prisma::{self, job, node},
+ prisma::{job, node},
};
use int_enum::IntEnum;
use rspc::Type;
@@ -117,7 +117,9 @@ impl JobManager {
ret
}
- pub async fn get_history(ctx: &LibraryContext) -> Result, prisma::QueryError> {
+ pub async fn get_history(
+ ctx: &LibraryContext,
+ ) -> Result, prisma_client_rust::QueryError> {
let jobs = ctx
.db
.job()
@@ -291,15 +293,17 @@ impl JobReport {
pub async fn update(&self, ctx: &LibraryContext) -> Result<(), JobError> {
ctx.db
.job()
- .find_unique(job::id::equals(self.id.as_bytes().to_vec()))
- .update(vec![
- job::status::set(self.status.int_value()),
- job::data::set(self.data.clone()),
- job::task_count::set(self.task_count),
- job::completed_task_count::set(self.completed_task_count),
- job::date_modified::set(chrono::Utc::now().into()),
- job::seconds_elapsed::set(self.seconds_elapsed),
- ])
+ .update(
+ job::id::equals(self.id.as_bytes().to_vec()),
+ vec![
+ job::status::set(self.status.int_value()),
+ job::data::set(self.data.clone()),
+ job::task_count::set(self.task_count),
+ job::completed_task_count::set(self.completed_task_count),
+ job::date_modified::set(chrono::Utc::now().into()),
+ job::seconds_elapsed::set(self.seconds_elapsed),
+ ],
+ )
.exec()
.await?;
Ok(())
diff --git a/core/src/job/mod.rs b/core/src/job/mod.rs
index 31b7ce16a..3ecd9015e 100644
--- a/core/src/job/mod.rs
+++ b/core/src/job/mod.rs
@@ -1,4 +1,4 @@
-use crate::{prisma, sys::LocationError};
+use crate::sys::LocationError;
use rmp_serde::{decode::Error as DecodeError, encode::Error as EncodeError};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use std::{collections::VecDeque, fmt::Debug};
@@ -14,7 +14,7 @@ pub use worker::*;
#[derive(Error, Debug)]
pub enum JobError {
#[error("Database error: {0}")]
- DatabaseError(#[from] prisma::QueryError),
+ DatabaseError(#[from] prisma_client_rust::QueryError),
#[error("Location error: {0}")]
LocationError(#[from] LocationError),
#[error("I/O error: {0}")]
diff --git a/core/src/library/library_manager.rs b/core/src/library/library_manager.rs
index 9f40cc5d6..2b873ea7a 100644
--- a/core/src/library/library_manager.rs
+++ b/core/src/library/library_manager.rs
@@ -10,11 +10,7 @@ use tokio::sync::RwLock;
use uuid::Uuid;
use crate::{
- invalidate_query,
- node::Platform,
- prisma::{self, node},
- util::db::load_and_migrate,
- NodeContext,
+ invalidate_query, node::Platform, prisma::node, util::db::load_and_migrate, NodeContext,
};
use super::{LibraryConfig, LibraryConfigWrapped, LibraryContext};
@@ -36,7 +32,7 @@ pub enum LibraryManagerError {
#[error("error serializing or deserializing the JSON in the config file")]
Json(#[from] serde_json::Error),
#[error("Database error: {0}")]
- Database(#[from] prisma::QueryError),
+ Database(#[from] prisma_client_rust::QueryError),
#[error("Library not found error")]
LibraryNotFound,
#[error("error migrating the config file")]
diff --git a/core/src/sys/locations.rs b/core/src/sys/locations.rs
index 6c1b54a99..1a34e1066 100644
--- a/core/src/sys/locations.rs
+++ b/core/src/sys/locations.rs
@@ -8,7 +8,7 @@ use crate::{
invalidate_query,
job::Job,
library::LibraryContext,
- prisma::{self, location},
+ prisma::location,
};
use rspc::ErrorCode;
@@ -195,7 +195,7 @@ pub enum LocationError {
#[error("Failed to connect to database (error: {0:?})")]
IOError(io::Error),
#[error("Database error")]
- DatabaseError(#[from] prisma::QueryError),
+ DatabaseError(#[from] prisma_client_rust::QueryError),
}
impl From for rspc::Error {
diff --git a/core/src/sys/volumes.rs b/core/src/sys/volumes.rs
index 81a3c3e06..dbf581570 100644
--- a/core/src/sys/volumes.rs
+++ b/core/src/sys/volumes.rs
@@ -1,7 +1,4 @@
-use crate::{
- library::LibraryContext,
- prisma::{self, volume::*},
-};
+use crate::{library::LibraryContext, prisma::volume::*};
use rspc::Type;
use serde::{Deserialize, Serialize};
use thiserror::Error;
@@ -24,7 +21,7 @@ pub struct Volume {
#[derive(Error, Debug)]
pub enum VolumeError {
#[error("Database error: {0}")]
- DatabaseErr(#[from] prisma::QueryError),
+ DatabaseErr(#[from] prisma_client_rust::QueryError),
#[error("FromUtf8Error: {0}")]
FromUtf8Error(#[from] std::string::FromUtf8Error),
}
diff --git a/core/src/util/db.rs b/core/src/util/db.rs
index 4ced4361a..9df21142e 100644
--- a/core/src/util/db.rs
+++ b/core/src/util/db.rs
@@ -14,7 +14,7 @@ pub enum MigrationError {
#[error("An error occurred while initialising a new database connection")]
DatabaseInitialization(#[from] NewClientError),
#[error("An error occurred with the database while applying migrations")]
- DatabaseError(#[from] prisma_client_rust::queries::Error),
+ DatabaseError(#[from] prisma_client_rust::QueryError),
#[error("An error occurred reading the embedded migration files. {0}. Please report to Spacedrive developers!")]
InvalidEmbeddedMigration(&'static str),
}
@@ -27,11 +27,12 @@ pub async fn load_and_migrate(db_url: &str) -> Result(raw!(
"SELECT name FROM sqlite_master WHERE type='table' AND name='_migrations'"
))
+ .exec()
.await?
.is_empty();
if migrations_table_missing {
- client._execute_raw(raw!(INIT_MIGRATION)).await?;
+ client._execute_raw(raw!(INIT_MIGRATION)).exec().await?;
}
let mut migration_directories = MIGRATIONS_DIR
@@ -102,11 +103,13 @@ pub async fn load_and_migrate(db_url: &str) -> Result>();
let steps = &steps[0..steps.len() - 1];
for (i, step) in steps.iter().enumerate() {
- client._execute_raw(raw!(*step)).await?;
+ client._execute_raw(raw!(*step)).exec().await?;
client
.migration()
- .find_unique(migration::checksum::equals(checksum.clone()))
- .update(vec![migration::steps_applied::set(i as i32 + 1)])
+ .update(
+ migration::checksum::equals(checksum.clone()),
+ vec![migration::steps_applied::set(i as i32 + 1)],
+ )
.exec()
.await?;
}
diff --git a/package.json b/package.json
index 4ea589009..763f3442a 100644
--- a/package.json
+++ b/package.json
@@ -26,15 +26,7 @@
"@cspell/dict-typescript": "^2.0.1",
"@evilmartians/lefthook": "^1.0.5",
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
- "@typescript-eslint/eslint-plugin": "^5.30.7",
- "@typescript-eslint/parser": "^5.30.7",
"cspell": "^6.4.0",
- "eslint": "^8.20.0",
- "eslint-config-prettier": "^8.5.0",
- "eslint-config-standard-with-typescript": "^22.0.0",
- "eslint-plugin-import": ">=2.25.2 <3.0.0",
- "eslint-plugin-n": ">=15.0.0 <16.0.0",
- "eslint-plugin-promise": ">=6.0.0 <7.0.0",
"markdown-link-check": "^3.10.2",
"prettier": "^2.7.1",
"typescript": "^4.7.4"
diff --git a/packages/client/src/context/AppPropsContext.tsx b/packages/client/src/context/AppPropsContext.tsx
index 59e6cf4b7..9b9f4d4a2 100644
--- a/packages/client/src/context/AppPropsContext.tsx
+++ b/packages/client/src/context/AppPropsContext.tsx
@@ -2,7 +2,7 @@ import { createContext } from 'react';
export const AppPropsContext = createContext(null);
-export type Platform = 'browser' | 'macOS' | 'windows' | 'linux';
+export type Platform = 'browser' | 'macOS' | 'windows' | 'linux' | 'unknown';
export type CdnUrl = 'internal' | string;
export interface AppProps {
diff --git a/packages/config/eslint-preset.js b/packages/config/eslint-preset.js
deleted file mode 100644
index c99e0d465..000000000
--- a/packages/config/eslint-preset.js
+++ /dev/null
@@ -1,11 +0,0 @@
-module.exports = {
- extends: ['next', 'prettier'],
- settings: {
- next: {
- rootDir: ['apps/*/', 'packages/*/']
- }
- },
- rules: {
- 'no-html-link-for-pages': 'off'
- }
-};
diff --git a/packages/config/eslint-react.js b/packages/config/eslint-react.js
new file mode 100644
index 000000000..5a232b963
--- /dev/null
+++ b/packages/config/eslint-react.js
@@ -0,0 +1,44 @@
+module.exports = {
+ env: {
+ browser: true,
+ node: true
+ },
+ parser: '@typescript-eslint/parser',
+ parserOptions: {
+ ecmaFeatures: {
+ jsx: true
+ },
+ ecmaVersion: 12,
+ sourceType: 'module'
+ },
+ extends: [
+ 'eslint:recommended',
+ 'plugin:react/recommended',
+ 'plugin:react-hooks/recommended',
+ 'plugin:@typescript-eslint/recommended',
+ 'prettier'
+ ],
+ plugins: ['react'],
+ rules: {
+ 'react/display-name': 'off',
+ 'react/prop-types': 'off',
+ 'react/no-unescaped-entities': 'off',
+ 'react/react-in-jsx-scope': 'off',
+ 'react-hooks/rules-of-hooks': 'error',
+ 'react-hooks/exhaustive-deps': 'warn',
+ '@typescript-eslint/no-unused-vars': 'off',
+ '@typescript-eslint/ban-ts-comment': 'off',
+ '@typescript-eslint/no-explicit-any': 'off',
+ '@typescript-eslint/no-var-requires': 'off',
+ '@typescript-eslint/no-non-null-assertion': 'off',
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
+ 'no-control-regex': 'off',
+ 'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs']
+ },
+ ignorePatterns: ['**/*.js', '**/*.json', 'node_modules'],
+ settings: {
+ react: {
+ version: 'detect'
+ }
+ }
+};
diff --git a/packages/config/package.json b/packages/config/package.json
index b91b1f836..6d9f656ba 100644
--- a/packages/config/package.json
+++ b/packages/config/package.json
@@ -4,6 +4,14 @@
"main": "index.js",
"license": "GPL-3.0-only",
"files": [
- "eslint-preset.js"
- ]
+ "eslint-react.js"
+ ],
+ "devDependencies": {
+ "eslint": "^8.21.0",
+ "@typescript-eslint/eslint-plugin": "^5.30.7",
+ "@typescript-eslint/parser": "^5.30.7",
+ "eslint-config-prettier": "^8.5.0",
+ "eslint-plugin-react": "^7.30.1",
+ "eslint-plugin-react-hooks": "^4.6.0"
+ }
}
diff --git a/packages/interface/.eslintrc.js b/packages/interface/.eslintrc.js
new file mode 100644
index 000000000..b3e0f403d
--- /dev/null
+++ b/packages/interface/.eslintrc.js
@@ -0,0 +1,7 @@
+module.exports = {
+ ...require('@sd/config/eslint-react.js'),
+ parserOptions: {
+ tsconfigRootDir: __dirname,
+ project: './tsconfig.json'
+ }
+};
diff --git a/packages/interface/package.json b/packages/interface/package.json
index 2f1961121..e3222e971 100644
--- a/packages/interface/package.json
+++ b/packages/interface/package.json
@@ -11,7 +11,8 @@
"./components/*": "./src/components/*"
},
"scripts": {
- "icons": "./scripts/generateSvgImports.mjs"
+ "icons": "./scripts/generateSvgImports.mjs",
+ "lint": "eslint src/**/*.{ts,tsx} && tsc --noEmit"
},
"dependencies": {
"@apollo/client": "^3.6.9",
@@ -67,6 +68,7 @@
"zustand": "4.0.0"
},
"devDependencies": {
+ "@sd/config": "workspace:*",
"@types/babel-core": "^6.25.7",
"@types/byte-size": "^8.1.0",
"@types/lodash": "^4.14.182",
diff --git a/packages/interface/src/App.tsx b/packages/interface/src/App.tsx
index 02484c6df..9b522df65 100644
--- a/packages/interface/src/App.tsx
+++ b/packages/interface/src/App.tsx
@@ -6,7 +6,7 @@ import {
useBridgeQuery,
useInvalidateQuery
} from '@sd/client';
-import { QueryClientProvider } from '@tanstack/react-query';
+import { QueryClientProvider, defaultContext } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import React, { useEffect, useState } from 'react';
import { ErrorBoundary } from 'react-error-boundary';
@@ -21,10 +21,10 @@ function RouterContainer(props: { props: AppProps }) {
const { data: client } = useBridgeQuery(['getNode']);
useEffect(() => {
- setAppProps({
+ setAppProps((appProps) => ({
...appProps,
data_path: client?.data_path
- });
+ }));
}, [client?.data_path]);
return (
@@ -39,10 +39,19 @@ function RouterContainer(props: { props: AppProps }) {
export default function SpacedriveInterface(props: AppProps) {
useInvalidateQuery();
+ // hotfix for bug where props are not updated, not sure of the cause
+ if (props.platform === 'unknown') {
+ // this should be a loading screen if we can't fix the issue above
+ return <>>;
+ }
+
return (
- {}}>
-
- {import.meta.env.MODE === 'development' && }
+
+
+ {/* The `context={defaultContext}` part is required for this to work on Windows. Why, idk, don't question it */}
+ {import.meta.env.MODE === 'development' && (
+
+ )}
diff --git a/packages/interface/src/AppRouter.tsx b/packages/interface/src/AppRouter.tsx
index c74fc65cb..cd1ed725b 100644
--- a/packages/interface/src/AppRouter.tsx
+++ b/packages/interface/src/AppRouter.tsx
@@ -44,7 +44,7 @@ export function AppRouter() {
if (libraryState.currentLibraryUuid === null && libraries && libraries.length > 0) {
libraryState.switchLibrary(libraries[0].uuid);
}
- }, [libraryState.currentLibraryUuid, libraries]);
+ }, [libraryState, libraryState.currentLibraryUuid, libraries]);
return (
<>
diff --git a/packages/interface/src/components/file/FileList.tsx b/packages/interface/src/components/file/FileList.tsx
index 4f88db3f5..a8f89d0db 100644
--- a/packages/interface/src/components/file/FileList.tsx
+++ b/packages/interface/src/components/file/FileList.tsx
@@ -73,10 +73,11 @@ export const FileList: React.FC<{ location_id: number; path: string; limit: numb
index: goingUp ? selectedRowIndex - 1 : selectedRowIndex
});
}
- }, [selectedRowIndex]);
+ }, [goingUp, selectedRowIndex]);
useEffect(() => {
setLocationId(props.location_id);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [props.location_id]);
useKey('ArrowUp', (e) => {
@@ -168,7 +169,7 @@ interface RenderItemProps {
const RenderGridItem: React.FC = ({ item, index, dirId }) => {
const { selectedRowIndex, setSelectedRowIndex } = useExplorerStore();
- let [_, setSearchParams] = useSearchParams();
+ const [_, setSearchParams] = useSearchParams();
return (
= ({ item, index, dirId }) => {
const RenderRow: React.FC = ({ item, index, dirId }) => {
const { selectedRowIndex, setSelectedRowIndex } = useExplorerStore();
const isActive = selectedRowIndex === index;
- let [_, setSearchParams] = useSearchParams();
+ const [_, setSearchParams] = useSearchParams();
return useMemo(
() => (
@@ -217,6 +218,7 @@ const RenderRow: React.FC = ({ item, index, dirId }) => {
))}
),
+ // eslint-disable-next-line react-hooks/exhaustive-deps
[item.id, isActive]
);
};
diff --git a/packages/interface/src/components/file/FileThumb.tsx b/packages/interface/src/components/file/FileThumb.tsx
index 162712245..e82f46832 100644
--- a/packages/interface/src/components/file/FileThumb.tsx
+++ b/packages/interface/src/components/file/FileThumb.tsx
@@ -32,7 +32,7 @@ export default function FileThumb(props: {
}
if (icons[props.file.extension as keyof typeof icons]) {
- let Icon = icons[props.file.extension as keyof typeof icons];
+ const Icon = icons[props.file.extension as keyof typeof icons];
return
;
}
return
;
diff --git a/packages/interface/src/components/file/Inspector.tsx b/packages/interface/src/components/file/Inspector.tsx
index 8d08d26ea..427e87260 100644
--- a/packages/interface/src/components/file/Inspector.tsx
+++ b/packages/interface/src/components/file/Inspector.tsx
@@ -62,6 +62,7 @@ export const Inspector = (props: {
return () => {
clearTimeout(handler);
};
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [note]);
const toggleFavorite = () => {
diff --git a/packages/interface/src/components/file/Sidebar.tsx b/packages/interface/src/components/file/Sidebar.tsx
index 5012f89ba..a9e074ead 100644
--- a/packages/interface/src/components/file/Sidebar.tsx
+++ b/packages/interface/src/components/file/Sidebar.tsx
@@ -18,7 +18,7 @@ import RunningJobsWidget from '../jobs/RunningJobsWidget';
import { MacTrafficLights } from '../os/TrafficLights';
import { DefaultProps } from '../primitive/types';
-interface SidebarProps extends DefaultProps {}
+type SidebarProps = DefaultProps;
export const SidebarLink = (props: NavLinkProps & { children: React.ReactNode }) => (
@@ -88,6 +88,7 @@ export const Sidebar: React.FC = (props) => {
useEffect(() => {
if (libraries && !currentLibraryUuid) initLibraries(libraries);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [libraries, currentLibraryUuid]);
const { mutate: createLocation } = useLibraryMutation('locations.create');
diff --git a/packages/interface/src/components/jobs/RunningJobsWidget.tsx b/packages/interface/src/components/jobs/RunningJobsWidget.tsx
index d042f4a15..5c23d5821 100644
--- a/packages/interface/src/components/jobs/RunningJobsWidget.tsx
+++ b/packages/interface/src/components/jobs/RunningJobsWidget.tsx
@@ -55,8 +55,9 @@ export default function RunningJobsWidget() {
return (
- {jobs?.map((job) => (
+ {jobs?.map((job, index) => (
, HTMLButtonElement> {
icon: React.ComponentType;
@@ -18,7 +18,7 @@ export interface TopBarButtonProps
left?: boolean;
right?: boolean;
}
-interface SearchBarProps extends DefaultProps {}
+type SearchBarProps = DefaultProps;
const TopBarButton: React.FC = ({
icon: Icon,
@@ -90,7 +90,7 @@ export const TopBar: React.FC = (props) => {
}
});
- let navigate = useNavigate();
+ const navigate = useNavigate();
return (
<>
diff --git a/packages/interface/src/screens/Content.tsx b/packages/interface/src/screens/Content.tsx
index 3166734ff..cb94ffc1e 100644
--- a/packages/interface/src/screens/Content.tsx
+++ b/packages/interface/src/screens/Content.tsx
@@ -1,6 +1,6 @@
import React from 'react';
-export const ContentScreen: React.FC<{}> = (props) => {
+export const ContentScreen: React.FC
= (props) => {
// const [address, setAddress] = React.useState('');
return (
diff --git a/packages/interface/src/screens/Debug.tsx b/packages/interface/src/screens/Debug.tsx
index 804b2066a..97326b21a 100644
--- a/packages/interface/src/screens/Debug.tsx
+++ b/packages/interface/src/screens/Debug.tsx
@@ -4,7 +4,7 @@ import React, { useContext } from 'react';
import CodeBlock from '../components/primitive/Codeblock';
-export const DebugScreen: React.FC<{}> = (props) => {
+export const DebugScreen: React.FC
= (props) => {
const appPropsContext = useContext(AppPropsContext);
const { data: nodeState } = useBridgeQuery(['getNode']);
const { data: libraryState } = useBridgeQuery(['library.get']);
diff --git a/packages/interface/src/screens/Explorer.tsx b/packages/interface/src/screens/Explorer.tsx
index d8ca6e066..8c408fb4f 100644
--- a/packages/interface/src/screens/Explorer.tsx
+++ b/packages/interface/src/screens/Explorer.tsx
@@ -6,12 +6,12 @@ import { FileList } from '../components/file/FileList';
import { Inspector } from '../components/file/Inspector';
import { TopBar } from '../components/layout/TopBar';
-export const ExplorerScreen: React.FC<{}> = () => {
- let [searchParams] = useSearchParams();
- let path = searchParams.get('path') || '';
+export const ExplorerScreen: React.FC = () => {
+ const [searchParams] = useSearchParams();
+ const path = searchParams.get('path') || '';
- let { id } = useParams();
- let location_id = Number(id);
+ const { id } = useParams();
+ const location_id = Number(id);
const [limit, setLimit] = React.useState(100);
diff --git a/packages/interface/src/screens/Overview.tsx b/packages/interface/src/screens/Overview.tsx
index 60ca38d26..2011fbff5 100644
--- a/packages/interface/src/screens/Overview.tsx
+++ b/packages/interface/src/screens/Overview.tsx
@@ -70,7 +70,7 @@ const StatItem: React.FC = (props) => {
setCount((count) => count + 1);
}, quadratic(appProps?.demoMode ? 1000 : 500, +size.value, count));
}
- }, [count, size]);
+ }, [appProps?.demoMode, count, size]);
return (
{
setOverviewStats(newStatistics);
}
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [appProps, libraryStatistics]);
// useEffect(() => {
@@ -187,7 +188,7 @@ export const OverviewScreen = () => {
{}}
+ // ctaAction={() => {}}
ctaLabel="Connect"
trigger={
= (props) => {
+export const PhotosScreen: React.FC = (props) => {
return (
diff --git a/packages/interface/src/screens/Redirect.tsx b/packages/interface/src/screens/Redirect.tsx
index 7e10a21e0..1b35e5440 100644
--- a/packages/interface/src/screens/Redirect.tsx
+++ b/packages/interface/src/screens/Redirect.tsx
@@ -12,6 +12,7 @@ export const RedirectPage: React.FC
= (props) => {
useEffect(() => {
navigate(destination);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return null;
diff --git a/packages/interface/src/screens/Tag.tsx b/packages/interface/src/screens/Tag.tsx
index e297a32f2..d64725629 100644
--- a/packages/interface/src/screens/Tag.tsx
+++ b/packages/interface/src/screens/Tag.tsx
@@ -1,8 +1,8 @@
import React from 'react';
import { useParams } from 'react-router-dom';
-export const TagScreen: React.FC<{}> = () => {
- let { id } = useParams();
+export const TagScreen: React.FC = () => {
+ const { id } = useParams();
return (
diff --git a/packages/interface/src/screens/settings/library/LibraryGeneralSettings.tsx b/packages/interface/src/screens/settings/library/LibraryGeneralSettings.tsx
index e787bb0df..5e59f90ce 100644
--- a/packages/interface/src/screens/settings/library/LibraryGeneralSettings.tsx
+++ b/packages/interface/src/screens/settings/library/LibraryGeneralSettings.tsx
@@ -35,6 +35,7 @@ export default function LibraryGeneralSettings() {
});
}
}
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [nameDebounced, descriptionDebounced]);
useEffect(() => {
@@ -42,6 +43,7 @@ export default function LibraryGeneralSettings() {
setName(currentLibrary.config.name);
setDescription(currentLibrary.config.description);
}
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [libraries]);
useEffect(() => {
@@ -50,6 +52,7 @@ export default function LibraryGeneralSettings() {
setName(currentLibrary.config.name);
setDescription(currentLibrary.config.description);
}
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [currentLibraryUuid]);
useEffect(() => {
diff --git a/packages/interface/src/screens/settings/library/TagsSettings.tsx b/packages/interface/src/screens/settings/library/TagsSettings.tsx
index fd9791294..4a4d3137d 100644
--- a/packages/interface/src/screens/settings/library/TagsSettings.tsx
+++ b/packages/interface/src/screens/settings/library/TagsSettings.tsx
@@ -47,10 +47,11 @@ export default function TagsSettings() {
if (!currentTag && tags?.length) {
setSelectedTag(tags[0].id);
}
- }, [tags]);
+ }, [currentTag, tags]);
useEffect(() => {
reset(currentTag);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [currentTag]);
const { register, handleSubmit, watch, reset, control } = useForm({
@@ -59,6 +60,7 @@ export default function TagsSettings() {
const submitTagUpdate = handleSubmit((data) => updateTag(data));
+ // eslint-disable-next-line react-hooks/exhaustive-deps
const autoUpdateTag = useCallback(useDebounce(submitTagUpdate, 500), []);
useEffect(() => {
diff --git a/packages/interface/src/screens/settings/node/LibrariesSettings.tsx b/packages/interface/src/screens/settings/node/LibrariesSettings.tsx
index 71afe42d9..bd6425d70 100644
--- a/packages/interface/src/screens/settings/node/LibrariesSettings.tsx
+++ b/packages/interface/src/screens/settings/node/LibrariesSettings.tsx
@@ -39,7 +39,7 @@ function LibraryListItem(props: { library: LibraryConfigWrapped }) {
ctaDanger
ctaLabel="Delete"
trigger={
- {}}>
+
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a06b10e41..a5adb3241 100644
Binary files a/pnpm-lock.yaml and b/pnpm-lock.yaml differ