jacob-ai-bot / jacob-figma

v1 for the Otto Figma plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JACoB AI Figma Plugin

The live version of the JACoB Figma Plugin is available here: https://www.figma.com/community/plugin/1326684504185921461/jacob-ai-codegen-connector

This repo is for developers who are looking to self-host JACoB and use the Figma Plugin within their local environment.

Development guide

This plugin is built with Create Figma Plugin. It is a combination of the preact-resizable and preact-tailwind templates.

Pre-requisites

Build the plugin

Update the 'API_URL' variable in the 'constants.ts' file with the endpoint for the JACoB API. For local development, the value should be:

export const API_URL = 'http://localhost:3000/api'

Update the 'baseUrl' variable in the 'authPageRedirect.ts' file with the url for JACoB. For local development, the value should be:

const baseUrl = "http://localhost:3000";

To build the plugin:

$ npm run build

This will generate a manifest.json file and a build/ directory containing the JavaScript bundle(s) for the plugin.

To watch for code changes and rebuild the plugin automatically:

$ npm run watch

Install the plugin

  1. In the Figma desktop app, open a Figma document.
  2. Search for and run Import plugin from manifest… via the Quick Actions search bar.
  3. Select the manifest.json file that was generated by the build script.

Debugging

Use console.log statements to inspect values in your code.

To open the developer console, search for and run Show/Hide Console via the Quick Actions search bar.

See also

License

Licensed under the Apache License 2.0. See the LICENSE file for more details.

Official docs and code samples from Figma:

About

v1 for the Otto Figma plugin

License:Apache License 2.0


Languages

Language:TypeScript 99.6%Language:JavaScript 0.4%Language:CSS 0.1%