feat: add desktop2

This commit is contained in:
reya 2024-02-11 09:30:18 +07:00
parent 35c5b5fb78
commit c809ab6b4e
18 changed files with 697 additions and 2927 deletions

24
apps/desktop2/.gitignore vendored Normal file
View File

@ -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?

17
apps/desktop2/index.html Normal file
View File

@ -0,0 +1,17 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lume Desktop</title>
</head>
<body
class="relative w-screen h-screen overflow-hidden font-sans antialiased cursor-default select-none text-neutral-950 dark:text-neutral-50">
<div class="fixed top-0 left-0 z-50 w-full h-9" data-tauri-drag-region></div>
<div id="root"></div>
<script type="module" src="/src/app.tsx"></script>
</body>
</html>

View File

@ -0,0 +1,33 @@
{
"name": "@lume/desktop2",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@tanstack/react-router": "^1.16.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@lume/tailwindcss": "workspace:^",
"@lume/tsconfig": "workspace:^",
"@lume/types": "workspace:^",
"@tanstack/router-devtools": "^1.16.0",
"@tanstack/router-vite-plugin": "^1.16.1",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.17",
"postcss": "^8.4.33",
"tailwindcss": "^3.4.1",
"typescript": "^5.2.2",
"vite": "^5.1.0",
"vite-plugin-top-level-await": "^1.4.1",
"vite-tsconfig-paths": "^4.3.1"
}
}

View File

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

View File

40
apps/desktop2/src/app.css Normal file
View File

@ -0,0 +1,40 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
html {
font-size: 14px;
}
a {
@apply cursor-default no-underline !important;
}
button {
@apply cursor-default focus:outline-none;
}
input::-ms-reveal,
input::-ms-clear {
display: none;
}
::-webkit-input-placeholder {
line-height: normal;
}
media-controller {
@apply w-full;
}
@layer utilities {
.content-break {
word-break: break-word;
word-wrap: break-word;
overflow-wrap: break-word;
}
.shadow-toolbar {
box-shadow: 0 0 #0000, 0 0 #0000, 0 8px 24px 0 rgba(0, 0, 0, .2), 0 2px 8px 0 rgba(0, 0, 0, .08), inset 0 0 0 1px rgba(0, 0, 0, .2), inset 0 0 0 2px hsla(0, 0%, 100%, .14)
}
}

28
apps/desktop2/src/app.tsx Normal file
View File

@ -0,0 +1,28 @@
import { RouterProvider, createRouter } from "@tanstack/react-router";
import React, { StrictMode } from "react";
import ReactDOM from "react-dom/client";
// Import the generated route tree
import { routeTree } from "./tree.gen";
// Create a new router instance
const router = createRouter({ routeTree });
// Register the router instance for type safety
declare module "@tanstack/react-router" {
interface Register {
router: typeof router;
}
}
// Render the app
// biome-ignore lint/style/noNonNullAssertion: <explanation>
const rootElement = document.getElementById("root")!;
if (!rootElement.innerHTML) {
const root = ReactDOM.createRoot(rootElement);
root.render(
<StrictMode>
<RouterProvider router={router} />
</StrictMode>,
);
}

View File

@ -0,0 +1,16 @@
import {
Outlet,
ScrollRestoration,
createRootRoute,
} from "@tanstack/react-router";
import { TanStackRouterDevtools } from "@tanstack/router-devtools";
export const Route = createRootRoute({
component: () => (
<>
<ScrollRestoration />
<Outlet />
<TanStackRouterDevtools />
</>
),
});

View File

@ -0,0 +1,13 @@
import { createLazyFileRoute } from "@tanstack/react-router";
export const Route = createLazyFileRoute("/")({
component: Index,
});
function Index() {
return (
<div className="p-2">
<h3>Welcome Home!</h3>
</div>
);
}

View File

@ -0,0 +1,43 @@
/* prettier-ignore-start */
/* eslint-disable */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// This file is auto-generated by TanStack Router
import { createFileRoute } from '@tanstack/react-router'
// Import Routes
import { Route as rootRoute } from './routes/__root'
// Create Virtual Routes
const IndexLazyImport = createFileRoute('/')()
// Create/Update Routes
const IndexLazyRoute = IndexLazyImport.update({
path: '/',
getParentRoute: () => rootRoute,
} as any).lazy(() => import('./routes/index.lazy').then((d) => d.Route))
// Populate the FileRoutesByPath interface
declare module '@tanstack/react-router' {
interface FileRoutesByPath {
'/': {
preLoaderRoute: typeof IndexLazyImport
parentRoute: typeof rootRoute
}
}
}
// Create and export the route tree
export const routeTree = rootRoute.addChildren([IndexLazyRoute])
/* prettier-ignore-end */

View File

@ -0,0 +1,14 @@
import sharedConfig from "@lume/tailwindcss";
const config = {
content: [
"./src/**/*.{js,ts,jsx,tsx}",
"../../packages/@columns/**/*{.js,.ts,.jsx,.tsx}",
"../../packages/ark/**/*{.js,.ts,.jsx,.tsx}",
"../../packages/ui/**/*{.js,.ts,.jsx,.tsx}",
"index.html",
],
presets: [sharedConfig],
};
export default config;

View File

@ -0,0 +1,8 @@
{
"extends": "@lume/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist"
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}

View File

@ -0,0 +1,6 @@
{
"routesDirectory": "./src/routes",
"generatedRouteTree": "./src/tree.gen.ts",
"routeFileIgnorePrefix": "-",
"quoteStyle": "single"
}

View File

@ -0,0 +1,30 @@
import { TanStackRouterVite } from "@tanstack/router-vite-plugin";
import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vite";
import topLevelAwait from "vite-plugin-top-level-await";
import viteTsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
plugins: [
react(),
viteTsconfigPaths(),
topLevelAwait({
promiseExportName: "__tla",
promiseImportName: (i) => `__tla_${i}`,
}),
TanStackRouterVite({
routesDirectory: "./src/routes",
generatedRouteTree: "./src/tree.gen.ts",
routeFileIgnorePrefix: "-",
quoteStyle: "single",
}),
],
build: {
outDir: "../../dist",
},
server: {
strictPort: true,
port: 3000,
},
clearScreen: false,
});

View File

@ -1,36 +1,36 @@
{
"name": "lume",
"private": true,
"version": "3.0.1",
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev",
"web:dev": "turbo run dev --filter web",
"desktop:dev": "turbo run dev --filter desktop",
"tauri": "tauri"
},
"devDependencies": {
"@biomejs/biome": "^1.5.3",
"@tauri-apps/cli": "^2.0.0-beta.1",
"turbo": "^1.12.2"
},
"packageManager": "pnpm@8.9.0",
"engines": {
"node": ">=18"
},
"dependencies": {
"@tauri-apps/api": "^2.0.0-beta.0",
"@tauri-apps/plugin-autostart": "^2.0.0-beta.0",
"@tauri-apps/plugin-clipboard-manager": "^2.0.0-beta.0",
"@tauri-apps/plugin-dialog": "^2.0.0-beta.0",
"@tauri-apps/plugin-fs": "^2.0.0-beta.0",
"@tauri-apps/plugin-http": "^2.0.0-beta.0",
"@tauri-apps/plugin-notification": "^2.0.0-beta.0",
"@tauri-apps/plugin-os": "^2.0.0-beta.0",
"@tauri-apps/plugin-process": "^2.0.0-beta.0",
"@tauri-apps/plugin-shell": "^2.0.0-beta.0",
"@tauri-apps/plugin-sql": "^2.0.0-beta.0",
"@tauri-apps/plugin-updater": "^2.0.0-beta.0",
"@tauri-apps/plugin-upload": "^2.0.0-beta.0"
}
"name": "lume",
"private": true,
"version": "3.0.1",
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev",
"web:dev": "turbo run dev --filter web",
"desktop:dev": "turbo run dev --filter desktop2",
"tauri": "tauri"
},
"devDependencies": {
"@biomejs/biome": "^1.5.3",
"@tauri-apps/cli": "^2.0.0-beta.1",
"turbo": "^1.12.2"
},
"packageManager": "pnpm@8.9.0",
"engines": {
"node": ">=18"
},
"dependencies": {
"@tauri-apps/api": "^2.0.0-beta.0",
"@tauri-apps/plugin-autostart": "^2.0.0-beta.0",
"@tauri-apps/plugin-clipboard-manager": "^2.0.0-beta.0",
"@tauri-apps/plugin-dialog": "^2.0.0-beta.0",
"@tauri-apps/plugin-fs": "^2.0.0-beta.0",
"@tauri-apps/plugin-http": "^2.0.0-beta.0",
"@tauri-apps/plugin-notification": "^2.0.0-beta.0",
"@tauri-apps/plugin-os": "^2.0.0-beta.0",
"@tauri-apps/plugin-process": "^2.0.0-beta.0",
"@tauri-apps/plugin-shell": "^2.0.0-beta.0",
"@tauri-apps/plugin-sql": "^2.0.0-beta.0",
"@tauri-apps/plugin-updater": "^2.0.0-beta.0",
"@tauri-apps/plugin-upload": "^2.0.0-beta.0"
}
}

View File

@ -16,6 +16,7 @@
"tailwindcss": "^3.4.1"
},
"dependencies": {
"@evilmartians/harmony": "^1.2.0"
"@evilmartians/harmony": "^1.2.0",
"tailwindcss-radix-colors": "^1.2.0"
}
}

View File

@ -1,8 +1,6 @@
import harmonyPalette from "@evilmartians/harmony/tailwind";
const config = {
theme: {
colors: harmonyPalette,
extend: {
keyframes: {
slideDownAndFade: {
@ -46,6 +44,7 @@ const config = {
plugins: [
require("@tailwindcss/forms"),
require("@tailwindcss/typography"),
require("tailwindcss-radix-colors"),
require("tailwind-scrollbar")({ nocompatible: true }),
],
};

File diff suppressed because it is too large Load Diff