From d9cab9138ed7aa644ff62adc0c62bfbb640ba3da Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Mon, 18 Apr 2022 17:34:39 -0700 Subject: [PATCH] build commands + web app renames --- apps/desktop/src/index.tsx | 11 +- apps/web/README.md | 44 +--- apps/web/components/Layout.tsx | 31 --- apps/web/components/global.scss | 8 - apps/{webapp => web}/index.html | 0 apps/web/next-env.d.ts | 5 - apps/web/package.json | 54 +++-- apps/web/pages/_app.tsx | 7 - apps/web/pages/index.tsx | 18 -- apps/web/postcss.config.js | 6 - apps/{webapp => web}/public/manifest.json | 0 apps/{webapp => web}/public/robots.txt | 0 apps/{webapp => web}/src/App.tsx | 4 +- apps/{webapp => web}/src/index.css | 0 apps/{webapp => web}/src/index.tsx | 0 apps/web/tailwind.config.js | 7 - apps/web/tsconfig.json | 21 +- apps/{webapp => web}/vite.config.ts | 0 apps/web/yarn.lock | 208 ------------------ apps/webapp/README.md | 1 - apps/webapp/package.json | 50 ----- apps/webapp/tsconfig.json | 26 --- package.json | 7 +- packages/interface/package.json | 4 +- packages/interface/src/App.tsx | 2 +- .../interface/src/assets/svg/folder-white.svg | 2 +- packages/interface/src/assets/svg/folder.svg | 2 +- .../src/components/file/FileItem.tsx | 12 +- .../src/components/file/FileThumb.tsx | 9 +- .../interface/src/components/file/Sidebar.tsx | 10 +- packages/interface/src/dev.tsx | 6 +- packages/interface/src/screens/Overview.tsx | 4 +- pnpm-lock.yaml | Bin 416092 -> 416093 bytes 33 files changed, 91 insertions(+), 468 deletions(-) delete mode 100644 apps/web/components/Layout.tsx delete mode 100644 apps/web/components/global.scss rename apps/{webapp => web}/index.html (100%) delete mode 100644 apps/web/next-env.d.ts delete mode 100644 apps/web/pages/_app.tsx delete mode 100644 apps/web/pages/index.tsx delete mode 100644 apps/web/postcss.config.js rename apps/{webapp => web}/public/manifest.json (100%) rename apps/{webapp => web}/public/robots.txt (100%) rename apps/{webapp => web}/src/App.tsx (93%) rename apps/{webapp => web}/src/index.css (100%) rename apps/{webapp => web}/src/index.tsx (100%) delete mode 100644 apps/web/tailwind.config.js rename apps/{webapp => web}/vite.config.ts (100%) delete mode 100644 apps/web/yarn.lock delete mode 100644 apps/webapp/README.md delete mode 100644 apps/webapp/package.json delete mode 100644 apps/webapp/tsconfig.json diff --git a/apps/desktop/src/index.tsx b/apps/desktop/src/index.tsx index f2eb22db7..534a5caf0 100644 --- a/apps/desktop/src/index.tsx +++ b/apps/desktop/src/index.tsx @@ -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 { - return Promise.resolve(); + openDialog={function (options: { + directory?: boolean | undefined; + }): Promise { + return dialog.open(options); }} /> ); diff --git a/apps/web/README.md b/apps/web/README.md index 897f79301..1865c0378 100644 --- a/apps/web/README.md +++ b/apps/web/README.md @@ -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 \ No newline at end of file diff --git a/apps/web/components/Layout.tsx b/apps/web/components/Layout.tsx deleted file mode 100644 index cb35cf876..000000000 --- a/apps/web/components/Layout.tsx +++ /dev/null @@ -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) => ( - <> - - {title} - - - -
- {/* */} -
-
{children as any}
- {/*
- Version 0.1.0 -
*/} - -); - -export default Layout; diff --git a/apps/web/components/global.scss b/apps/web/components/global.scss deleted file mode 100644 index deb636ec1..000000000 --- a/apps/web/components/global.scss +++ /dev/null @@ -1,8 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - - -html { - // background-color: black; -} \ No newline at end of file diff --git a/apps/webapp/index.html b/apps/web/index.html similarity index 100% rename from apps/webapp/index.html rename to apps/web/index.html diff --git a/apps/web/next-env.d.ts b/apps/web/next-env.d.ts deleted file mode 100644 index 4f11a03dc..000000000 --- a/apps/web/next-env.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -/// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/apps/web/package.json b/apps/web/package.json index 153b76e08..9a79ac93f 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -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" + ] } } diff --git a/apps/web/pages/_app.tsx b/apps/web/pages/_app.tsx deleted file mode 100644 index fa9af6e2a..000000000 --- a/apps/web/pages/_app.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import '../components/global.scss'; - -function MyApp({ Component, pageProps }) { - return ; -} - -export default MyApp; diff --git a/apps/web/pages/index.tsx b/apps/web/pages/index.tsx deleted file mode 100644 index cc241ad49..000000000 --- a/apps/web/pages/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import Link from 'next/link'; -import Layout from '../components/Layout'; - -// import Spacedrive interface - -const IndexPage = () => ( - -

A file explorer from the future

-