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() {