build commands + web app renames

This commit is contained in:
Jamie Pine
2022-04-18 17:34:39 -07:00
parent 470ceaffae
commit d9cab9138e
33 changed files with 91 additions and 468 deletions

View File

@@ -10,7 +10,8 @@ import { ClientCommand, ClientQuery, CoreEvent } from '@sd/core';
// import Spacedrive JS client
import { BaseTransport } from '@sd/client';
// import tauri apis
import { invoke, os } from '@tauri-apps/api';
import { dialog, invoke, os } from '@tauri-apps/api';
import { convertFileSrc } from '@tauri-apps/api/tauri';
// bind state to core via Tauri
class Transport extends BaseTransport {
@@ -50,10 +51,12 @@ function App() {
}}
platform={platform}
convertFileSrc={function (url: string): string {
return url;
return convertFileSrc(url);
}}
openDialog={function (options: { directory?: boolean | undefined }): Promise<void> {
return Promise.resolve();
openDialog={function (options: {
directory?: boolean | undefined;
}): Promise<string | string[]> {
return dialog.open(options);
}}
/>
);

View File

@@ -1,43 +1 @@
# TypeScript Next.js example
This is a really simple project that shows the usage of Next.js with TypeScript.
## Deploy your own
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) or preview live with [StackBlitz](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/with-typescript)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-typescript&project-name=with-typescript&repository-name=with-typescript)
## How to use it?
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
```bash
npx create-next-app --example with-typescript with-typescript-app
# or
yarn create next-app --example with-typescript with-typescript-app
# or
pnpm create next-app -- --example with-typescript with-typescript-app
```
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
## Notes
This example shows how to integrate the TypeScript type system into Next.js. Since TypeScript is supported out of the box with Next.js, all we have to do is to install TypeScript.
```
npm install --save-dev typescript
```
To enable TypeScript's features, we install the type declarations for React and Node.
```
npm install --save-dev @types/react @types/react-dom @types/node
```
When we run `next dev` the next time, Next.js will start looking for any `.ts` or `.tsx` files in our project and builds it. It even automatically creates a `tsconfig.json` file for our project with the recommended settings.
Next.js has built-in TypeScript declarations, so we'll get autocompletion for Next.js' modules straight away.
A `type-check` script is also added to `package.json`, which runs TypeScript's `tsc` CLI in `noEmit` mode to run type-checking separately. You can then include this, for example, in your `test` scripts.
# Spacedrive Webapp

View File

@@ -1,31 +0,0 @@
import React, { ReactNode } from 'react';
import Link from 'next/link';
import Head from 'next/head';
type Props = {
children?: ReactNode;
title?: string;
};
const Layout = ({ children, title = 'This is the default title' }: Props) => (
<>
<Head>
<title>{title}</title>
<meta charSet="utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
</Head>
<header>
{/* <nav>
<Link href="/">
<a>Home</a>
</Link>{' '}
</nav> */}
</header>
<div className="flex flex-col items-center p-1 ">{children as any}</div>
{/* <footer className="bg-gray-100 ">
<span>Version 0.1.0</span>
</footer> */}
</>
);
export default Layout;

View File

@@ -1,8 +0,0 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
html {
// background-color: black;
}

View File

@@ -1,5 +0,0 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

View File

@@ -1,26 +1,50 @@
{
"name": "@sd/web",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start",
"type-check": "tsc"
"dev": "vite",
"build": "tsc && vite build",
"serve": "vite preview"
},
"dependencies": {
"@sd/interface": "*",
"autoprefixer": "^10.4.4",
"next": "latest",
"postcss": "^8.4.12",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"sass": "^1.50.0",
"tailwindcss": "^3.0.23"
"@sd/core": "*",
"@sd/client": "*",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.1.1",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.4.1",
"@types/node": "^16.11.27",
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-scripts": "5.0.1",
"typescript": "^4.6.3",
"web-vitals": "^2.1.4"
},
"devDependencies": {
"@types/node": "^12.12.21",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.1",
"typescript": "4.0"
"vite": "^2.9.1",
"@vitejs/plugin-react": "^1.3.1",
"vite-plugin-react-svg": "^0.2.0"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

View File

@@ -1,7 +0,0 @@
import '../components/global.scss';
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />;
}
export default MyApp;

View File

@@ -1,18 +0,0 @@
import Link from 'next/link';
import Layout from '../components/Layout';
// import Spacedrive interface
const IndexPage = () => (
<Layout title="Home | Next.js + TypeScript Example">
<h1 className="my-8 text-4xl font-black">A file explorer from the future</h1>
<iframe
style={{ border: 'none', borderRadius: 5 }}
width={1200}
height={600}
src="http://localhost:8002?library_id=9068c6ec-cf90-451b-bb30-4174781e7bc6"
/>
</Layout>
);
export default IndexPage;

View File

@@ -1,6 +0,0 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};

View File

@@ -29,8 +29,8 @@ function App() {
convertFileSrc={function (url: string): string {
return url;
}}
openDialog={function (options: { directory?: boolean }): Promise<void> {
return Promise.resolve();
openDialog={function (options: { directory?: boolean }): Promise<string | string[]> {
return Promise.resolve('');
}}
/>
</div>

View File

@@ -1,7 +0,0 @@
module.exports = {
content: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {}
},
plugins: []
};

View File

@@ -1,19 +1,26 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
"noEmit": true,
"jsx": "react-jsx"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"include": [
"src"
]
}

View File

@@ -1,208 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@next/env@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/env/-/env-12.1.5.tgz#a21ba6708022d630402ca2b340316e69a0296dfc"
integrity sha512-+34yUJslfJi7Lyx6ELuN8nWcOzi27izfYnZIC1Dqv7kmmfiBVxgzR3BXhlvEMTKC2IRJhXVs2FkMY+buQe3k7Q==
"@next/swc-android-arm-eabi@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.1.5.tgz#36729ab3dfd7743e82cfe536b43254dcb146620c"
integrity sha512-SKnGTdYcoN04Y2DvE0/Y7/MjkA+ltsmbuH/y/hR7Ob7tsj+8ZdOYuk+YvW1B8dY20nDPHP58XgDTSm2nA8BzzA==
"@next/swc-android-arm64@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.1.5.tgz#52578f552305c92d0b9b81d603c9643fb71e0835"
integrity sha512-YXiqgQ/9Rxg1dXp6brXbeQM1JDx9SwUY/36JiE+36FXqYEmDYbxld9qkX6GEzkc5rbwJ+RCitargnzEtwGW0mw==
"@next/swc-darwin-arm64@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.1.5.tgz#3d5b53211484c72074f4975ba0ec2b1107db300e"
integrity sha512-y8mhldb/WFZ6lFeowkGfi0cO/lBdiBqDk4T4LZLvCpoQp4Or/NzUN6P5NzBQZ5/b4oUHM/wQICEM+1wKA4qIVw==
"@next/swc-darwin-x64@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.1.5.tgz#adcabb732d226453777c0d37d58eaff9328b66fd"
integrity sha512-wqJ3X7WQdTwSGi0kIDEmzw34QHISRIQ5uvC+VXmsIlCPFcMA+zM5723uh8NfuKGquDMiEMS31a83QgkuHMYbwQ==
"@next/swc-linux-arm-gnueabihf@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.1.5.tgz#82a7cde67482b756bc65fbebf1dfa8a782074e93"
integrity sha512-WnhdM5duONMvt2CncAl+9pim0wBxDS2lHoo7ub/o/i1bRbs11UTzosKzEXVaTDCUkCX2c32lIDi1WcN2ZPkcdw==
"@next/swc-linux-arm64-gnu@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.1.5.tgz#f82ca014504950aab751e81f467492e9be0bad5d"
integrity sha512-Jq2H68yQ4bLUhR/XQnbw3LDW0GMQn355qx6rU36BthDLeGue7YV7MqNPa8GKvrpPocEMW77nWx/1yI6w6J07gw==
"@next/swc-linux-arm64-musl@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.1.5.tgz#f811ec9f4b12a978426c284c95ab2f515ddf7f9e"
integrity sha512-KgPjwdbhDqXI7ghNN8V/WAiLquc9Ebe8KBrNNEL0NQr+yd9CyKJ6KqjayVkmX+hbHzbyvbui/5wh/p3CZQ9xcQ==
"@next/swc-linux-x64-gnu@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.1.5.tgz#d44857257e6d20dc841998951d584ab1f25772c3"
integrity sha512-O2ErUTvCJ6DkNTSr9pbu1n3tcqykqE/ebty1rwClzIYdOgpB3T2MfEPP+K7GhUR87wmN/hlihO9ch7qpVFDGKw==
"@next/swc-linux-x64-musl@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.1.5.tgz#3cc523abadc9a2a6de680593aff06e71cc29ecef"
integrity sha512-1eIlZmlO/VRjxxzUBcVosf54AFU3ltAzHi+BJA+9U/lPxCYIsT+R4uO3QksRzRjKWhVQMRjEnlXyyq5SKJm7BA==
"@next/swc-win32-arm64-msvc@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.1.5.tgz#c62232d869f1f9b22e8f24e4e7f05307c20f30ca"
integrity sha512-oromsfokbEuVb0CBLLE7R9qX3KGXucZpsojLpzUh1QJjuy1QkrPJncwr8xmWQnwgtQ6ecMWXgXPB+qtvizT9Tw==
"@next/swc-win32-ia32-msvc@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.1.5.tgz#2bd9b28a9ba730d12a493e7d9d18e150fe89d496"
integrity sha512-a/51L5KzBpeZSW9LbekMo3I3Cwul+V+QKwbEIMA+Qwb2qrlcn1L9h3lt8cHqNTFt2y72ce6aTwDTw1lyi5oIRA==
"@next/swc-win32-x64-msvc@12.1.5":
version "12.1.5"
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.1.5.tgz#02f377e4d41eaaacf265e34bab9bacd8efc4a351"
integrity sha512-/SoXW1Ntpmpw3AXAzfDRaQidnd8kbZ2oSni8u5z0yw6t4RwJvmdZy1eOaAADRThWKV+2oU90++LSnXJIwBRWYQ==
"@types/node@^12.12.21":
version "12.20.47"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.47.tgz#ca9237d51f2a2557419688511dab1c8daf475188"
integrity sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==
"@types/prop-types@*":
version "15.7.5"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==
"@types/react-dom@^17.0.1":
version "17.0.15"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.15.tgz#f2c8efde11521a4b7991e076cb9c70ba3bb0d156"
integrity sha512-Tr9VU9DvNoHDWlmecmcsE5ZZiUkYx+nKBzum4Oxe1K0yJVyBlfbq7H3eXjxXqJczBKqPGq3EgfTru4MgKb9+Yw==
dependencies:
"@types/react" "^17"
"@types/react@^17", "@types/react@^17.0.2":
version "17.0.44"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.44.tgz#c3714bd34dd551ab20b8015d9d0dbec812a51ec7"
integrity sha512-Ye0nlw09GeMp2Suh8qoOv0odfgCoowfM/9MG6WeRD60Gq9wS90bdkdRtYbRkNhXOpG4H+YXGvj4wOWhAC0LJ1g==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
csstype "^3.0.2"
"@types/scheduler@*":
version "0.16.2"
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"
integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==
caniuse-lite@^1.0.30001283:
version "1.0.30001331"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001331.tgz#41048f2a5cf0c3c6198f40207cd323388b3d4399"
integrity sha512-Y1xk6paHpUXKP/P6YjQv1xqyTbgAP05ycHBcRdQjTcyXlWol868sJJPlmk5ylOekw2BrucWes5jk+LvVd7WZ5Q==
csstype@^3.0.2:
version "3.0.11"
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.11.tgz#d66700c5eacfac1940deb4e3ee5642792d85cd33"
integrity sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==
"js-tokens@^3.0.0 || ^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
loose-envify@^1.1.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
dependencies:
js-tokens "^3.0.0 || ^4.0.0"
nanoid@^3.1.30:
version "3.3.2"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.2.tgz#c89622fafb4381cd221421c69ec58547a1eec557"
integrity sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==
next@latest:
version "12.1.5"
resolved "https://registry.yarnpkg.com/next/-/next-12.1.5.tgz#7a07687579ddce61ee519493e1c178d83abac063"
integrity sha512-YGHDpyfgCfnT5GZObsKepmRnne7Kzp7nGrac07dikhutWQug7hHg85/+sPJ4ZW5Q2pDkb+n0FnmLkmd44htIJQ==
dependencies:
"@next/env" "12.1.5"
caniuse-lite "^1.0.30001283"
postcss "8.4.5"
styled-jsx "5.0.1"
optionalDependencies:
"@next/swc-android-arm-eabi" "12.1.5"
"@next/swc-android-arm64" "12.1.5"
"@next/swc-darwin-arm64" "12.1.5"
"@next/swc-darwin-x64" "12.1.5"
"@next/swc-linux-arm-gnueabihf" "12.1.5"
"@next/swc-linux-arm64-gnu" "12.1.5"
"@next/swc-linux-arm64-musl" "12.1.5"
"@next/swc-linux-x64-gnu" "12.1.5"
"@next/swc-linux-x64-musl" "12.1.5"
"@next/swc-win32-arm64-msvc" "12.1.5"
"@next/swc-win32-ia32-msvc" "12.1.5"
"@next/swc-win32-x64-msvc" "12.1.5"
object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
picocolors@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
postcss@8.4.5:
version "8.4.5"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.5.tgz#bae665764dfd4c6fcc24dc0fdf7e7aa00cc77f95"
integrity sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==
dependencies:
nanoid "^3.1.30"
picocolors "^1.0.0"
source-map-js "^1.0.1"
react-dom@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
scheduler "^0.20.2"
react@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
scheduler@^0.20.2:
version "0.20.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
source-map-js@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
styled-jsx@5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.1.tgz#78fecbbad2bf95ce6cd981a08918ce4696f5fc80"
integrity sha512-+PIZ/6Uk40mphiQJJI1202b+/dYeTVd9ZnMPR80pgiWbjIwvN2zIp4r9et0BgqBuShh48I0gttPlAXA7WVvBxw==
typescript@4.0:
version "4.0.8"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.8.tgz#5739105541db80a971fdbd0d56511d1a6f17d37f"
integrity sha512-oz1765PN+imfz1MlZzSZPtC/tqcwsCyIYA8L47EkRnRW97ztRk83SzMiWLrnChC0vqoYxSU1fcFUDA5gV/ZiPg==

View File

@@ -1 +0,0 @@
# Spacedrive Webapp

View File

@@ -1,50 +0,0 @@
{
"name": "@sd/webapp",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"serve": "vite preview"
},
"dependencies": {
"@sd/interface": "*",
"@sd/core": "*",
"@sd/client": "*",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.1.1",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.4.1",
"@types/node": "^16.11.27",
"@types/react": "^18.0.5",
"@types/react-dom": "^18.0.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-scripts": "5.0.1",
"typescript": "^4.6.3",
"web-vitals": "^2.1.4"
},
"devDependencies": {
"vite": "^2.9.1",
"@vitejs/plugin-react": "^1.3.1",
"vite-plugin-react-svg": "^0.2.0"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

View File

@@ -1,26 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
}

View File

@@ -4,9 +4,10 @@
"private": true,
"scripts": {
"prep": "pnpm db:gen && pnpm core codegen && pnpm build-packages",
"build-packages": "pnpm client build && pnpm ui build",
"build-packages": "pnpm client build && pnpm ui build && pnpm interface build",
"build": "turbo run build",
"dev": "turbo run dev --parallel --scope=@sd/desktop --scope=@sd/client --scope=@sd/ui",
"dev:desktop": "turbo run dev --parallel --filter=@sd/desktop --filter=@sd/client --filter=@sd/ui --filter=@sd/interface",
"dev:ui": "turbo run dev --parallel --filter=@sd/client --filter=@sd/ui --filter=@sd/interface",
"db:migrate": "pnpm core prisma migrate dev",
"db:gen": "pnpm core prisma generate",
"lint": "turbo run lint",
@@ -14,7 +15,7 @@
"desktop": "pnpm --filter @sd/desktop -- ",
"mobile": "pnpm --filter @sd/mobile -- ",
"web": "pnpm --filter @sd/web -- ",
"webapp": "pnpm --filter @sd/webapp -- ",
"landing": "pnpm --filter @sd/landing -- ",
"ui": "pnpm --filter @sd/ui -- ",
"interface": "pnpm --filter @sd/interface -- ",
"core": "pnpm --filter @sd/core -- ",

View File

@@ -17,8 +17,8 @@
"license": "MIT",
"private": true,
"scripts": {
"dev": "vite build --watch",
"vite": "vite",
"dev": "vite",
"dev:build": "vite build --watch",
"build": "vite build"
},
"resolutions": {

View File

@@ -37,7 +37,7 @@ export interface AppProps {
onCoreEvent: (event: CoreEvent) => void;
platform: Platform;
convertFileSrc: (url: string) => string;
openDialog: (options: { directory?: boolean }) => Promise<void>;
openDialog: (options: { directory?: boolean }) => Promise<string | string[]>;
onClose?: () => void;
onMinimize?: () => void;
onFullscreen?: () => void;

View File

@@ -1,4 +1,4 @@
<svg width="141" height="110" viewBox="0 0 141 110" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg style="width: 100%; height: auto;" viewBox="0 0 141 110" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 15.5273C0 7.15264 6.78899 0.363647 15.1636 0.363647H35.9094C39.3671 0.363647 42.7035 1.63836 45.2803 3.94395C47.8571 6.24955 51.1935 7.52425 54.6512 7.52425H123.836C132.211 7.52425 139 14.3132 139 22.6879V23.9515C139 32.3262 132.211 39.1152 123.836 39.1152H15.1636C6.78899 39.1152 0 32.3262 0 23.9515V15.5273Z" fill="url(#paint0_linear_0_3)"/>
<path d="M0 29.8485C0 23.8001 4.90316 18.897 10.9515 18.897H128.048C134.097 18.897 139 23.8001 139 29.8485V94.7152C139 103.09 132.211 109.879 123.836 109.879H15.1636C6.78899 109.879 0 103.09 0 94.7152V29.8485Z" fill="url(#paint1_linear_0_3)"/>
<path d="M0.582787 99.2818L140.005 100" stroke="white" stroke-opacity="0.03" stroke-width="2"/>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,4 +1,4 @@
<svg width="141" height="110" viewBox="0 0 141 110" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg style="width: 100%; height: auto;" viewBox="0 0 141 110" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 15.5273C0 7.15264 6.78899 0.363647 15.1636 0.363647H35.9094C39.3671 0.363647 42.7035 1.63836 45.2803 3.94395V3.94395C47.8571 6.24955 51.1935 7.52425 54.6512 7.52425H123.836C132.211 7.52425 139 14.3132 139 22.6879V23.9515C139 32.3262 132.211 39.1152 123.836 39.1152H15.1636C6.78899 39.1152 0 32.3262 0 23.9515V15.5273Z" fill="url(#paint0_linear_13_627)"/>
<path d="M0 29.8485C0 23.8001 4.90316 18.897 10.9515 18.897H128.048C134.097 18.897 139 23.8001 139 29.8485V94.7152C139 103.09 132.211 109.879 123.836 109.879H15.1636C6.78899 109.879 0 103.09 0 94.7152V29.8485Z" fill="url(#paint1_linear_13_627)"/>
<line x1="0.424076" y1="97.8758" x2="139.002" y2="98.1576" stroke="black" stroke-opacity="0.13" stroke-width="1.68485"/>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -34,15 +34,11 @@ export default function FileItem(props: Props) {
}
)}
>
{/* <Shadow /> */}
{/* <div className="w-[65px] border border-gray-600 m-auto rounded-md h-[80px] bg-gray-650 relative shadow-md "> */}
{props.folder ? (
<div className="relative w-full h-full active:translate-y-[1px]">
{/* <img
className="bottom-0 p-3 pt-[19px] margin-auto z-90 pointer-events-none"
src="/svg/folder.svg"
/> */}
<Folder className="w-[70px] m-auto -mt-1.5" />
<div className="flex items-center justify-center w-full h-full active:translate-y-[1px]">
<div className="w-[70px]">
<Folder className="" />
</div>
</div>
) : (
<div

View File

@@ -5,6 +5,8 @@ import clsx from 'clsx';
import React, { useContext } from 'react';
import { AppPropsContext } from '../../App';
import Folder from '../../assets/svg/folder.svg?component';
export default function FileThumb(props: {
file: FilePath;
locationId: number;
@@ -14,12 +16,7 @@ export default function FileThumb(props: {
const { data: client } = useBridgeQuery('ClientGetState');
if (props.file.is_dir) {
return (
<img
className={clsx('mt-0.5 pointer-events-none z-90', props.className)}
src="/svg/folder.svg"
/>
);
return <Folder className="" />;
}
if (props.file.has_local_thumbnail && client?.data_path) {

View File

@@ -12,6 +12,9 @@ import { useBridgeCommand, useBridgeQuery } from '@sd/client';
import RunningJobsWidget from '../jobs/RunningJobsWidget';
import { AppPropsContext } from '../../App';
import Folder from '../../assets/svg/folder.svg?component';
import FolderWhite from '../../assets/svg/folder-white.svg?component';
interface SidebarProps extends DefaultProps {}
export const SidebarLink = (props: NavLinkProps & { children: React.ReactNode }) => (
@@ -140,10 +143,9 @@ export const Sidebar: React.FC<SidebarProps> = (props) => {
}
)}
>
<img
className="w-4 h-4 mr-2 pointer-events-none z-90"
src={`/svg/${isActive ? 'folder-white' : 'folder'}.svg`}
/>
<div className="w-[18px] mr-2 -mt-0.5">
{isActive ? <FolderWhite /> : <Folder />}
</div>
{location.name}
<div className="flex-grow" />
</span>

View File

@@ -25,8 +25,10 @@ root.render(
convertFileSrc={function (url: string): string {
return url;
}}
openDialog={function (options: { directory?: boolean | undefined }): Promise<void> {
return Promise.resolve();
openDialog={function (options: {
directory?: boolean | undefined;
}): Promise<string | string[]> {
return Promise.resolve('');
}}
/>
</React.StrictMode>

View File

@@ -39,11 +39,11 @@ export const OverviewScreen: React.FC<{}> = (props) => {
<StatItem name="Preview media" value="23.5" unit="GB" />
</div>
<div className="flex flex-col items-center w-56">
<img
{/* <img
alt="spacedrive-logo"
src="/images/spacedrive_logo.png"
className="pointer-events-none w-28 h-28"
/>
/> */}
{/* <span className="text-lg font-bold heading-1">Spacedrive</span>
<span className="mt-0.5 text-sm text-gray-400 mb-5">v1.0.11 (pre-alpha)</span> */}
{/* <span className="font-bold text-gray-400 text-md heading-1">Jamie's Library</span>

BIN
pnpm-lock.yaml generated
View File

Binary file not shown.