Skip to content

Commit abf123c

Browse files
committed
feat: launch public website
1 parent 18296f8 commit abf123c

106 files changed

Lines changed: 5922 additions & 4730 deletions

File tree

Some content is hidden

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

‎.github/workflows/test.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
- uses: actions/checkout@v6
1717
- uses: pnpm/action-setup@v6
1818
with:
19-
version: 9.14.4
19+
version: ^11
2020
- uses: actions/setup-node@v6
2121
with:
22-
node-version: 22.12.0
22+
node-version: ">=24"
2323
cache: pnpm
2424
- run: pnpm install --frozen-lockfile
2525
- run: pnpm build

‎.gitignore‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
dist
33
.next
44
out/
5+
*.tsbuildinfo
56

67
# dependencies
78
node_modules
@@ -28,4 +29,5 @@ test/**/next-env.d.ts
2829
**/.vscode
2930

3031
build
31-
.turbo
32+
.turbo
33+
.vercel

‎.oxfmtrc.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"printWidth": 80,
4+
"ignorePatterns": ["packages/backend/src/api_types.ts"]
5+
}

‎.oxlintrc.json‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"categories": {
4+
"correctness": "error"
5+
},
6+
"plugins": [
7+
"eslint",
8+
"typescript",
9+
"unicorn",
10+
"oxc",
11+
"react",
12+
"jsx-a11y",
13+
"nextjs",
14+
"vitest"
15+
],
16+
"options": {
17+
"denyWarnings": true,
18+
"reportUnusedDisableDirectives": "error"
19+
},
20+
"rules": {
21+
"eslint/no-await-in-loop": "off",
22+
"eslint/no-underscore-dangle": "off",
23+
"react/react-in-jsx-scope": "off",
24+
"unicorn/consistent-function-scoping": "off",
25+
"unicorn/no-array-reverse": "off",
26+
"unicorn/no-array-sort": "off",
27+
"unicorn/no-instanceof-builtins": "off",
28+
"unicorn/no-useless-length-check": "off",
29+
"unicorn/prefer-add-event-listener": "off",
30+
"unicorn/require-post-message-target-origin": "off"
31+
},
32+
"settings": {
33+
"next": {
34+
"rootDir": ["apps/web/"]
35+
},
36+
"react": {
37+
"version": "19.2"
38+
}
39+
}
40+
}

‎.prettierrc‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎.vercelignore‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.git
2+
.vercel
3+
.turbo
4+
.crush
5+
.idea
6+
.vscode
7+
**/.next
8+
**/.turbo
9+
**/node_modules
10+
coverage
11+
web
12+
apps/plugin/dist
13+
dist

‎README.md‎

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
<p align="center">
88
<a href="https://github.com/bernaferrari/FigmaToCode/actions/"><img src="https://github.com/bernaferrari/FigmaToCode/workflows/CI/badge.svg"/></a>
9-
<a href="https://codecov.io/gh/bernaferrari/FigmaToCode"><img src="https://codecov.io/gh/bernaferrari/FigmaToCode/branch/master/graph/badge.svg" /></a>
9+
<a href="https://codecov.io/gh/bernaferrari/FigmaToCode"><img src="https://codecov.io/gh/bernaferrari/FigmaToCode/branch/main/graph/badge.svg" /></a>
1010
<a href="http://twitter.com/bernaferrari">
1111
<img src="https://img.shields.io/badge/Twitter-@bernaferrari-brightgreen.svg?style=flat" alt="Twitter"/></a>
1212
</p><p align="center">
1313
<a href="https://www.figma.com/community/plugin/842128343887142055"><img src="assets/badge.png" height="60"/></a>
1414
</p>
1515

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. 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.
1717

1818
![Gif showing the conversion](assets/lossy_gif.gif)
1919

@@ -50,28 +50,30 @@ Converting visual designs to code inevitably encounters complex edge cases. Here
5050
### Todo
5151

5252
- Vectors (possible to enable in HTML and Tailwind)
53-
- Images (possible to enable to inline them in HTML and Tailwind)
5453
- Line/Star/Polygon
5554

5655
## How to build the project
5756

5857
### Package Manager
5958

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+
```
6164

6265
### Monorepo
6366

6467
The plugin is organized as a monorepo. There are several packages:
6568

6669
- `packages/backend` - Contains the business logic that reads the Figma API and converts nodes
6770
- `packages/plugin-ui` - Contains the common UI for the plugin
68-
- `packages/eslint-config-custom` - Config file for ESLint
6971
- `packages/tsconfig` - Collection of TSConfig files used throughout the project
7072

7173
- `apps/plugin` - This is the actual plugin assembled from the parts in `backend` & `plugin-ui`. Within this folder it's divided between:
7274
- `plugin-src` - loads from `backend` and compiles to `code.js`
7375
- `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.
7577

7678
### Development Workflow
7779

@@ -81,13 +83,13 @@ The project uses [Turborepo](https://turborepo.com/) for managing the monorepo,
8183

8284
You have two main options for development:
8385

84-
1. **Root development mode** (includes debug UI):
86+
1. **Root development mode** (includes the website):
8587

8688
```bash
8789
pnpm dev
8890
```
8991

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`.
9193

9294
2. **Plugin-only development mode**:
9395

@@ -96,7 +98,7 @@ You have two main options for development:
9698
pnpm dev
9799
```
98100

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.
100102

101103
#### Where to Make Changes
102104

@@ -105,8 +107,9 @@ Most of your development work will happen in these directories:
105107
- `packages/backend` - For plugin backend
106108
- `packages/plugin-ui` - For plugin UI
107109
- `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.
108111

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/`.
110113

111114
#### Commands
112115

@@ -115,12 +118,14 @@ You'll rarely need to modify files directly in the `apps/` directory, as they mo
115118
- `dev` - runs the app in dev mode. This can be run in the Figma editor.
116119
- `build` - builds the project for production
117120
- `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
120125

121-
#### Debug mode
126+
#### Website
122127

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.
124129

125130
<img width="600" alt="Screenshot 2024-12-13 at 16 26 43" src="https://github.com/user-attachments/assets/427fb066-70e1-47bd-8718-51f7f4d83e35" />
126131

‎apps/debug/.eslintrc.js‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎apps/debug/.prettierrc‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎apps/debug/README.md‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)