Skip to content

Commit 3deca94

Browse files
authored
feat: flow desktop app foundations (#240)
1 parent 127ca04 commit 3deca94

File tree

116 files changed

+28822
-64
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+28822
-64
lines changed

desktop/.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Logs
2+
*.log
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
pnpm-debug.log*
7+
lerna-debug.log*
8+
9+
node_modules
10+
dist
11+
dist-ssr
12+
*.local
13+
14+
# Editor directories and files
15+
.vscode/*
16+
!.vscode/extensions.json
17+
.idea
18+
.DS_Store
19+
*.suo
20+
*.ntvs*
21+
*.njsproj
22+
*.sln
23+
*.sw?
24+
25+
*storybook.log
26+
storybook-static

desktop/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v23.9.0

desktop/.storybook/decorators.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import { MantineProvider } from '@mantine/core';
3+
import { theme } from '../src/theme';
4+
5+
export const withMantine = (Story: React.ComponentType) => (
6+
<MantineProvider theme={theme}>
7+
<Story />
8+
</MantineProvider>
9+
);

desktop/.storybook/main.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { StorybookConfig } from '@storybook/react-vite';
2+
3+
const config: StorybookConfig = {
4+
"stories": [
5+
"../src/**/*.mdx",
6+
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
7+
],
8+
"addons": [
9+
"@storybook/addon-onboarding",
10+
"@chromatic-com/storybook",
11+
"@storybook/addon-docs",
12+
"@storybook/addon-a11y",
13+
"@storybook/addon-vitest"
14+
],
15+
"framework": {
16+
"name": "@storybook/react-vite",
17+
"options": {}
18+
}
19+
};
20+
export default config;

desktop/.storybook/preview.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import type { Preview } from '@storybook/react-vite'
2+
import '@mantine/core/styles.css'
3+
import { withMantine } from './decorators'
4+
5+
const preview: Preview = {
6+
parameters: {
7+
controls: {
8+
matchers: {
9+
color: /(background|color)$/i,
10+
date: /Date$/i,
11+
},
12+
},
13+
14+
a11y: {
15+
// 'todo' - show a11y violations in the test UI only
16+
// 'error' - fail CI on a11y violations
17+
// 'off' - skip a11y checks entirely
18+
test: 'todo'
19+
}
20+
},
21+
decorators: [withMantine],
22+
};
23+
24+
export default preview;
25+

desktop/.storybook/vitest.setup.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
2+
import { setProjectAnnotations } from '@storybook/react-vite';
3+
import * as projectAnnotations from './preview';
4+
5+
// This is an important step to apply the right configuration when testing your stories.
6+
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
7+
setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);

desktop/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# flow Desktop
2+
3+
A desktop application built with Tauri, React, and Mantine for managing workspaces and flows.
4+
5+
## Development
6+
7+
This project uses Tauri v2 with React and TypeScript for the frontend, and Rust for the backend.
8+
9+
### Prerequisites
10+
11+
- Node.js (latest stable version)
12+
- Rust (latest stable version)
13+
- Tauri CLI
14+
15+
### Getting Started
16+
17+
1. Install dependencies:
18+
```bash
19+
npm install
20+
```
21+
22+
2. Start the development server:
23+
```bash
24+
npm run dev
25+
```
26+
27+
3. Build the application:
28+
```bash
29+
npm run build
30+
```
31+
32+
### Available Scripts
33+
34+
- `npm run dev` - Start the development server
35+
- `npm run build` - Build the application for production
36+
- `npm run preview` - Preview the built application
37+
- `npm run tauri` - Run Tauri CLI commands
38+
- `npm run generate-types` - Generate TypeScript types from JSON schemas
39+
- `npm run storybook` - Start Storybook for component development
40+
- `npm run build-storybook` - Build Storybook for production

desktop/development.flow

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# yaml-language-server: $schema=https://flowexec.io/schemas/flowfile_schema.json
2+
visibility: private
3+
tags: [development, tauri]
4+
executables:
5+
- verb: install
6+
name: modules
7+
aliases: [node-modules, nodemod]
8+
exec:
9+
dir: //desktop
10+
cmd: npm install
11+
- verb: start
12+
name: storybook
13+
description: Start the Tauri desktop app's Storybook server.
14+
timeout: "24h"
15+
exec:
16+
dir: //desktop
17+
cmd: npm run storybook
18+
19+
- verb: start
20+
name: tauri
21+
aliases: [desktop]
22+
description: Start the Tauri desktop app in development mode.
23+
timeout: "24h"
24+
exec:
25+
dir: //desktop
26+
cmd: npm run tauri dev
27+
28+
- verb: generate
29+
name: frontend
30+
aliases: [js-types, ts-types, frontend-types]
31+
description: Generate code for the Tauri desktop app's frontend.
32+
exec:
33+
dir: //desktop
34+
cmd: npm run generate-types
35+
36+
- verb: lint
37+
name: frontend
38+
description: Run eslint on the Tauri desktop app's frontend.
39+
exec:
40+
dir: //desktop
41+
cmd: npm run lint
42+
43+
- verb: generate
44+
name: backend
45+
description: Generate code for the Tauri desktop app's backend.
46+
exec:
47+
dir: //desktop
48+
cmd: ./scripts/generate-rust-types.sh
49+
50+
- verb: generate
51+
name: tauri
52+
description: Generate code for the Tauri frontend and backend.
53+
parallel:
54+
execs:
55+
- ref: generate frontend
56+
- ref: generate backend
57+
58+
- verb: test
59+
name: form-demo
60+
description: Test executable to demonstrate the new form functionality with parameters and arguments.
61+
exec:
62+
dir: //desktop
63+
cmd: echo "Testing form functionality"
64+
params:
65+
- prompt: "What is your name?"
66+
envKey: "USER_NAME"
67+
- prompt: "What is your favorite color?"
68+
envKey: "FAVORITE_COLOR"
69+
- text: "demo"
70+
envKey: "DEMO_MODE"
71+
args:
72+
- pos: 1
73+
envKey: "MESSAGE"
74+
required: true
75+
type: "string"
76+
- flag: "verbose"
77+
envKey: "VERBOSE"
78+
type: "bool"
79+
default: "false"
80+
- flag: "count"
81+
envKey: "COUNT"
82+
type: "int"
83+
default: "1"

desktop/eslint.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import tseslint from "typescript-eslint";
4+
import pluginReact from "eslint-plugin-react";
5+
import { defineConfig } from "eslint/config";
6+
7+
8+
export default defineConfig([
9+
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], plugins: { js }, extends: ["js/recommended"] },
10+
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], languageOptions: { globals: globals.browser } },
11+
tseslint.configs.recommended,
12+
pluginReact.configs.flat.recommended,
13+
{
14+
rules: {
15+
"react/react-in-jsx-scope": "off",
16+
},
17+
},
18+
]);

desktop/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>flow Desktop</title>
8+
</head>
9+
10+
<body>
11+
<div id="root"></div>
12+
<script type="module" src="/src/main.tsx"></script>
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)