vibefigma 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,110 @@
1
+ # Functional Source License, Version 1.1, MIT Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-MIT
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 VibeFlowing Inc.
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the MIT license that is effective on the second anniversary of the date we make
91
+ the Software available. On or after that date, you may use the Software under
92
+ the MIT license, in which case the following will apply:
93
+
94
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
95
+ this software and associated documentation files (the "Software"), to deal in
96
+ the Software without restriction, including without limitation the rights to
97
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
98
+ of the Software, and to permit persons to whom the Software is furnished to do
99
+ so, subject to the following conditions:
100
+
101
+ The above copyright notice and this permission notice shall be included in all
102
+ copies or substantial portions of the Software.
103
+
104
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
107
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
108
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
109
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
110
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,32 @@
1
+ NOTICE
2
+
3
+ This project includes code derived from the following open source projects:
4
+
5
+ ================================================================================
6
+
7
+ css-to-tailwindcss
8
+ Copyright (c) 2023 Salakhutdinov Salavat
9
+ License: MIT
10
+ Source: https://github.com/Jackardios/css-to-tailwindcss
11
+
12
+ The MIT License requires the following notice:
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+
32
+ ================================================================================
package/README.md ADDED
@@ -0,0 +1,216 @@
1
+ # VibeFigma - Figma to React Converter
2
+
3
+ Transform your Figma designs into production-ready React components with Tailwind CSS automatically. VibeFigma leverages the official Figma API to accurately extract design information and generate clean, maintainable code.
4
+
5
+ ## Demo
6
+
7
+ <div align="center">
8
+ <a href="https://www.youtube.com/watch?v=6DhaK_thwkc">
9
+ <img src="https://img.youtube.com/vi/6DhaK_thwkc/maxresdefault.jpg" alt="VibeFigma Demo" style="width:100%;max-width:720px;">
10
+ </a>
11
+ </div>
12
+
13
+ ## CLI in Action
14
+
15
+ <div align="center">
16
+ <img src=".github/cli-demo.png" alt="VibeFigma CLI Demo" style="width:100%;max-width:800px;">
17
+ </div>
18
+
19
+ ## Features
20
+
21
+ - **Official Figma API Integration** - Direct integration with Figma's API for accurate design extraction
22
+ - **React Component Generation** - Convert Figma frames to React/TypeScript components
23
+ - **Tailwind CSS Support** - Automatic Tailwind class generation (enabled by default)
24
+ - **Code Optimization** - Optional AI-powered code cleanup
25
+
26
+ ## Quick Start
27
+
28
+ ### Using npx (Recommended)
29
+
30
+ No installation required! Just run:
31
+
32
+ ```bash
33
+ npx vibefigma [figma-url] --token YOUR_FIGMA_TOKEN
34
+
35
+ # Example with a public design:
36
+ npx vibefigma https://www.figma.com/design/rZbJ7EQucq6UCkqlIl1a6P/Personal-Portfolio-Website-Template--Community?node-id=7-191 --token YOUR_TOKEN
37
+ ```
38
+
39
+ ### Using Environment Variable
40
+
41
+ Set your Figma token once:
42
+
43
+ ```bash
44
+ export FIGMA_TOKEN=your_figma_access_token
45
+ npx vibefigma https://www.figma.com/design/YOUR_FILE_ID
46
+ ```
47
+
48
+ ### Interactive Mode
49
+
50
+ ```bash
51
+ npx vibefigma --interactive
52
+ ```
53
+
54
+ This will prompt you for:
55
+ - Figma URL
56
+ - Access token (if not set in environment)
57
+ - Output paths
58
+
59
+ ## Usage
60
+
61
+ ### Basic Usage
62
+
63
+ ```bash
64
+ # Convert a Figma design to React component
65
+ npx vibefigma https://www.figma.com/design/YOUR_FILE_ID?node-id=X-Y
66
+ ```
67
+
68
+ ### Custom Output Paths
69
+
70
+ ```bash
71
+ # Save to specific directory
72
+ npx vibefigma [url] -c ./src/components -a ./public/assets
73
+
74
+ # Save to specific file
75
+ npx vibefigma [url] -c ./src/components/Hero.tsx
76
+ ```
77
+
78
+ ### Disable Tailwind CSS
79
+
80
+ ```bash
81
+ # Generate regular CSS instead of Tailwind
82
+ npx vibefigma [url] --no-tailwind
83
+ ```
84
+
85
+ ### Advanced Options
86
+
87
+ ```bash
88
+ npx vibefigma [url] \
89
+ --token YOUR_TOKEN \
90
+ --component ./src/components \
91
+ --assets ./public/assets \
92
+ --optimize \
93
+ --clean
94
+ ```
95
+
96
+ ## 🔑 Getting a Figma Access Token
97
+
98
+ 1. Go to [Figma Account Settings](https://www.figma.com/settings)
99
+ 2. Scroll to **Personal Access Tokens**
100
+ 3. Click **Generate new token**
101
+ 4. Give it a name and click **Generate**
102
+ 5. Copy the token (you won't see it again!)
103
+
104
+ Set it as an environment variable:
105
+
106
+ ```bash
107
+ # Linux/Mac
108
+ export FIGMA_TOKEN=your_token_here
109
+
110
+ # Windows (PowerShell)
111
+ $env:FIGMA_TOKEN="your_token_here"
112
+
113
+ # Windows (CMD)
114
+ set FIGMA_TOKEN=your_token_here
115
+ ```
116
+
117
+ ## Command Options
118
+
119
+ ```
120
+ Usage: vibefigma [options] [url]
121
+
122
+ Convert Figma designs to React components
123
+
124
+ Arguments:
125
+ url Figma file/node URL
126
+
127
+ Options:
128
+ -V, --version Output the version number
129
+ -t, --token <token> Figma access token (overrides FIGMA_TOKEN env var)
130
+ -u, --url <url> Figma file/node URL
131
+ -c, --component <path> Component output path (default: ./src/components/[ComponentName].tsx)
132
+ -a, --assets <dir> Assets directory (default: ./public)
133
+ --no-tailwind Disable Tailwind CSS (enabled by default)
134
+ --optimize Optimize components
135
+ --clean Use AI code cleaner (requires GOOGLE_GENERATIVE_AI_API_KEY)
136
+ --no-classes Don't generate CSS classes
137
+ --no-absolute Don't use absolute positioning
138
+ --no-responsive Disable responsive design
139
+ --no-fonts Don't include fonts
140
+ --interactive Force interactive mode
141
+ -h, --help Display help for command
142
+ ```
143
+
144
+ ## 🛠️ Development
145
+
146
+ ### API Server
147
+
148
+ This project also includes a REST API server:
149
+
150
+ ```bash
151
+ # Install dependencies
152
+ bun install
153
+
154
+ # Run development server
155
+ bun run dev
156
+
157
+ # Server runs on http://localhost:3000
158
+ ```
159
+
160
+ ### CLI Development
161
+
162
+ ```bash
163
+ # Run CLI in development mode
164
+ bun run dev:cli
165
+
166
+ # Build CLI
167
+ bun run build:cli
168
+
169
+ # Test CLI locally
170
+ bun run cli -- --help
171
+ ```
172
+
173
+ ## API Usage
174
+
175
+ The project includes a REST API for Figma to React conversion:
176
+
177
+ ```bash
178
+ POST /v1/api/vibe-figma
179
+ ```
180
+
181
+ See [API.md](docs/API.md) for full API documentation.
182
+
183
+ ## Configuration
184
+
185
+ ### Environment Variables
186
+
187
+ Create a `.env` file:
188
+
189
+ ```env
190
+ # Required for CLI
191
+ FIGMA_TOKEN=your_figma_access_token
192
+
193
+ # Optional: For AI code cleanup feature
194
+ GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_key
195
+
196
+ # API Server Configuration (for development server)
197
+ PORT=3000
198
+ HOST=0.0.0.0
199
+ CORS_ORIGIN=*
200
+ ```
201
+
202
+ ## Contributing
203
+
204
+ Contributions are welcome! Please feel free to submit a Pull Request.
205
+
206
+ ## Acknowledgments
207
+
208
+ This project includes code derived from [css-to-tailwindcss](https://github.com/Jackardios/css-to-tailwindcss) by Salakhutdinov Salavat, licensed under the MIT License.
209
+
210
+ ## License
211
+
212
+ Copyright 2026 VibeFlowing Inc.
213
+
214
+ This project is licensed under the Functional Source License, Version 1.1, MIT Future License (FSL-1.1-MIT). See the [LICENSE](LICENSE) file for the full license text.
215
+
216
+ See the [NOTICE](NOTICE) file for details about third-party code used in this project.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../dist/cli/index.js'
Binary file