You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit abf123c
Browse filesBrowse the repository at this point in the historyBrowse files
Converting Figma designs into usable code can be a challenge, often requiring time-consuming manual work. Figma to Code simplifies that process. This plugin generates responsive layouts in `HTML`, `React (JSX)`, `Svelte`, `styled-components`, `Tailwind`, `Flutter`, and `SwiftUI` directly from your designs. Your feedback and ideas are always welcome.
16
+
Converting Figma designs into usable code can be a challenge, often requiring time-consuming manual work. Figma to Code simplifies that process. This plugin generates responsive layouts in `HTML`, `React (JSX)`, `Svelte`, `styled-components`, `Tailwind`, `Flutter`, and `SwiftUI` directly from your designs. Supported targets can also be downloaded as complete starter projects with local image assets and setup instructions. Your feedback and ideas are always welcome.
17
17
18
18

19
19
@@ -50,28 +50,30 @@ Converting visual designs to code inevitably encounters complex edge cases. Here
50
50
### Todo
51
51
52
52
- Vectors (possible to enable in HTML and Tailwind)
53
-
- Images (possible to enable to inline them in HTML and Tailwind)
54
53
- Line/Star/Polygon
55
54
56
55
## How to build the project
57
56
58
57
### Package Manager
59
58
60
-
The project is configured for [pnpm](https://pnpm.io/). To install, see the [installation notes for pnpm](https://pnpm.io/installation).
59
+
Development requires Node.js `>=24` and pnpm `^11`. Install pnpm using the [official installation instructions](https://pnpm.io/installation), then install the workspace from the repository root:
60
+
61
+
```bash
62
+
pnpm install
63
+
```
61
64
62
65
### Monorepo
63
66
64
67
The plugin is organized as a monorepo. There are several packages:
65
68
66
69
-`packages/backend` - Contains the business logic that reads the Figma API and converts nodes
67
70
-`packages/plugin-ui` - Contains the common UI for the plugin
68
-
-`packages/eslint-config-custom` - Config file for ESLint
69
71
-`packages/tsconfig` - Collection of TSConfig files used throughout the project
70
72
71
73
-`apps/plugin` - This is the actual plugin assembled from the parts in `backend` & `plugin-ui`. Within this folder it's divided between:
72
74
-`plugin-src` - loads from `backend` and compiles to `code.js`
73
75
-`ui-src` - loads the common `plugin-ui` and compiles to `index.html`
74
-
-`apps/debug` - This is a debug mode plugin that is a more convenient way to see all the UI elements.
76
+
-`apps/web` - The public product website and an interactive browser preview of the shared plugin UI.
75
77
76
78
### Development Workflow
77
79
@@ -81,13 +83,13 @@ The project uses [Turborepo](https://turborepo.com/) for managing the monorepo,
81
83
82
84
You have two main options for development:
83
85
84
-
1.**Root development mode** (includes debug UI):
86
+
1.**Root development mode** (includes the website):
85
87
86
88
```bash
87
89
pnpm dev
88
90
```
89
91
90
-
This runs the plugin in dev mode and also starts a Next.js server for the debug UI. You can access the debug UI at `http://localhost:3000`.
92
+
This runs the plugin in dev mode and starts the Next.js website at `http://localhost:3000`.
91
93
92
94
2.**Plugin-only development mode**:
93
95
@@ -96,7 +98,7 @@ You have two main options for development:
96
98
pnpm dev
97
99
```
98
100
99
-
This focuses only on the plugin without the Next.js debug UI. Use this when you're making changes specifically to the plugin.
101
+
This focuses only on the plugin without the Next.js website. Use this when you're making changes specifically to the plugin.
100
102
101
103
#### Where to Make Changes
102
104
@@ -105,8 +107,9 @@ Most of your development work will happen in these directories:
105
107
-`packages/backend` - For plugin backend
106
108
-`packages/plugin-ui` - For plugin UI
107
109
-`apps/plugin/` - The main plugin result that combines the backend and UI and is called by Figma.
110
+
-`apps/web/` - The public website, comparison pages, SEO metadata, and interactive plugin preview.
108
111
109
-
You'll rarely need to modify files directly in the `apps/` directory, as they mostly contain build configuration.
112
+
The two app directories contain their platform-specific entry points and build configuration; shared behavior belongs in `packages/`.
110
113
111
114
#### Commands
112
115
@@ -115,12 +118,14 @@ You'll rarely need to modify files directly in the `apps/` directory, as they mo
115
118
-`dev` - runs the app in dev mode. This can be run in the Figma editor.
116
119
-`build` - builds the project for production
117
120
-`build:watch` - builds and watches for changes
118
-
-`lint` - runs ESLint
119
-
-`format` - formats with prettier (warning: may edit files!)
121
+
-`lint` - runs Oxlint
122
+
-`test` - runs the automated test suite
123
+
-`format` - formats the repository with Oxfmt
124
+
-`format:check` - checks formatting without changing files
120
125
121
-
#### Debug mode
126
+
#### Website
122
127
123
-
When running the `dev` task, you can open `http://localhost:3000` to see the debug version of the UI.
128
+
When running the `dev` task, open `http://localhost:3000` to view the product website and interactive plugin preview.
124
129
125
130
<imgwidth="600"alt="Screenshot 2024-12-13 at 16 26 43"src="https://github.com/user-attachments/assets/427fb066-70e1-47bd-8718-51f7f4d83e35" />
0 commit comments