From b00961165e6a5cd3e89cb00fe6ca90bf24f52f41 Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Wed, 20 Apr 2022 01:15:28 -0700 Subject: [PATCH] holy mother of hot reload Co-authored-by: Brendan Allan --- apps/desktop/tailwind.config.js | 2 +- apps/desktop/vite.config.ts | 13 -- apps/landing/.gitignore | 24 ++ apps/landing/README.md | 43 ---- apps/landing/components/Layout.tsx | 33 --- apps/landing/components/global.scss | 3 - apps/landing/index.html | 13 ++ apps/landing/next-env.d.ts | 5 - apps/landing/next.config.js | 5 - apps/landing/package.json | 35 +-- apps/landing/pages/_app.tsx | 7 - apps/landing/pages/index.tsx | 27 --- apps/landing/postcss.config.js | 7 +- apps/landing/src/App.tsx | 28 +++ apps/landing/{components => src}/Bubbles.tsx | 4 +- apps/landing/src/favicon.svg | 15 ++ apps/landing/src/index.css | 13 ++ apps/landing/src/logo.svg | 7 + apps/landing/src/main.tsx | 10 + apps/landing/src/vite-env.d.ts | 1 + apps/landing/tailwind.config.js | 105 +-------- apps/landing/tsconfig.json | 41 ++-- apps/landing/tsconfig.node.json | 8 + apps/landing/vite.config.ts | 12 + apps/landing/yarn.lock | 208 ------------------ apps/web/package.json | 47 +--- apps/web/src/App.tsx | 2 - apps/web/src/index.css | 10 - apps/web/src/index.tsx | 2 +- apps/web/tailwind.config.js | 2 +- apps/web/vite.config.ts | 15 +- packages/client/package.json | 5 +- packages/interface/package.json | 1 + .../src/components/file/FileList.tsx | 9 +- packages/ui/package.json | 5 +- packages/ui/src/index.ts | 2 - packages/ui/style/tailwind.config.js | 108 --------- packages/ui/style/tailwind.js | 113 ++++++++++ pnpm-lock.yaml | Bin 191317 -> 180386 bytes 39 files changed, 310 insertions(+), 680 deletions(-) create mode 100644 apps/landing/.gitignore delete mode 100644 apps/landing/README.md delete mode 100644 apps/landing/components/Layout.tsx delete mode 100644 apps/landing/components/global.scss create mode 100644 apps/landing/index.html delete mode 100644 apps/landing/next-env.d.ts delete mode 100644 apps/landing/next.config.js delete mode 100644 apps/landing/pages/_app.tsx delete mode 100644 apps/landing/pages/index.tsx create mode 100644 apps/landing/src/App.tsx rename apps/landing/{components => src}/Bubbles.tsx (93%) create mode 100644 apps/landing/src/favicon.svg create mode 100644 apps/landing/src/index.css create mode 100644 apps/landing/src/logo.svg create mode 100644 apps/landing/src/main.tsx create mode 100644 apps/landing/src/vite-env.d.ts create mode 100644 apps/landing/tsconfig.node.json create mode 100644 apps/landing/vite.config.ts delete mode 100644 apps/landing/yarn.lock delete mode 100644 apps/web/src/index.css delete mode 100644 packages/ui/style/tailwind.config.js create mode 100644 packages/ui/style/tailwind.js diff --git a/apps/desktop/tailwind.config.js b/apps/desktop/tailwind.config.js index 55ea44fdc..f9d8b0e5f 100644 --- a/apps/desktop/tailwind.config.js +++ b/apps/desktop/tailwind.config.js @@ -1 +1 @@ -module.exports = require('@sd/ui/tailwind'); +module.exports = require('@sd/ui/tailwind')('desktop'); diff --git a/apps/desktop/vite.config.ts b/apps/desktop/vite.config.ts index 38b6e92e7..2bc86c870 100644 --- a/apps/desktop/vite.config.ts +++ b/apps/desktop/vite.config.ts @@ -4,9 +4,6 @@ import { name, version } from './package.json'; import * as path from 'path'; import svgr from '@honkhonk/vite-plugin-svgr'; -function resolvePackage(name: string) { - return path.resolve(require.resolve(`${name}/package.json`), '../src'); -} // https://vitejs.dev/config/ export default defineConfig({ server: { @@ -23,16 +20,6 @@ export default defineConfig({ define: { pkgJson: { name, version } }, - optimizeDeps: { - include: ['@sd/interface', '@sd/ui', '@sd/client'] - }, - resolve: { - alias: { - '@sd/interface': resolvePackage('@sd/interface'), - '@sd/ui': resolvePackage('@sd/ui'), - '@sd/client': resolvePackage('@sd/client') - } - }, build: { outDir: '../dist', assetsDir: '.' diff --git a/apps/landing/.gitignore b/apps/landing/.gitignore new file mode 100644 index 000000000..a547bf36d --- /dev/null +++ b/apps/landing/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/apps/landing/README.md b/apps/landing/README.md deleted file mode 100644 index 897f79301..000000000 --- a/apps/landing/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# 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. diff --git a/apps/landing/components/Layout.tsx b/apps/landing/components/Layout.tsx deleted file mode 100644 index e0e172ce3..000000000 --- a/apps/landing/components/Layout.tsx +++ /dev/null @@ -1,33 +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 = 'Spacedrive' }: Props) => ( - <> - - {title} - - - -
- {/* */} -
-
- {children as any} -
- {/*
- Version 0.1.0 -
*/} - -); - -export default Layout; diff --git a/apps/landing/components/global.scss b/apps/landing/components/global.scss deleted file mode 100644 index bd6213e1d..000000000 --- a/apps/landing/components/global.scss +++ /dev/null @@ -1,3 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; \ No newline at end of file diff --git a/apps/landing/index.html b/apps/landing/index.html new file mode 100644 index 000000000..38f386110 --- /dev/null +++ b/apps/landing/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/apps/landing/next-env.d.ts b/apps/landing/next-env.d.ts deleted file mode 100644 index 4f11a03dc..000000000 --- a/apps/landing/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/landing/next.config.js b/apps/landing/next.config.js deleted file mode 100644 index 1403639ed..000000000 --- a/apps/landing/next.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - experimental: { - externalDir: true - } -}; diff --git a/apps/landing/package.json b/apps/landing/package.json index 0794e9969..b3a282c4d 100644 --- a/apps/landing/package.json +++ b/apps/landing/package.json @@ -1,29 +1,30 @@ { "name": "@sd/landing", "private": true, + "version": "0.0.0", "scripts": { - "dev": "next -p 8003", - "build": "next build", - "start": "next start", - "type-check": "tsc" + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview" }, "dependencies": { - "@sd/interface": "*", - "@sd/ui": "*", - "autoprefixer": "^10.4.4", - "next": "latest", - "postcss": "^8.4.12", - "react": "^17.0.2", - "react-dom": "^17.0.2", + "@sd/client": "workspace:*", + "@sd/core": "workspace:*", + "@sd/interface": "workspace:*", + "@sd/ui": "workspace:*", + "react": "^18.0.0", + "react-dom": "^18.0.0", "react-tsparticles": "^2.0.6", - "sass": "^1.50.0", - "tailwindcss": "^3.0.23", "tsparticles": "^2.0.6" }, "devDependencies": { - "@types/node": "^12.12.21", - "@types/react": "^17.0.2", - "@types/react-dom": "^17.0.1", - "typescript": "^4.6.3" + "@types/react": "^18.0.0", + "@types/react-dom": "^18.0.0", + "@vitejs/plugin-react": "^1.3.1", + "autoprefixer": "^10.4.4", + "postcss": "^8.4.12", + "tailwind": "^4.0.0", + "typescript": "^4.6.3", + "vite": "^2.9.5" } } diff --git a/apps/landing/pages/_app.tsx b/apps/landing/pages/_app.tsx deleted file mode 100644 index fa9af6e2a..000000000 --- a/apps/landing/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/landing/pages/index.tsx b/apps/landing/pages/index.tsx deleted file mode 100644 index b7575489a..000000000 --- a/apps/landing/pages/index.tsx +++ /dev/null @@ -1,27 +0,0 @@ -// import Link from 'next/link'; -import Layout from '../components/Layout'; -import { Bubbles } from '../components/Bubbles'; -import { Button } from '@sd/ui'; - -const IndexPage = () => ( - - -

The file explorer from the future

-

- Spacedrive is the first file manager that puts the full power of the cloud in your hands. -

- - -