Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Compose] Code connect, publish function problem #228

Open
thxallgrace opened this issue Dec 19, 2024 · 3 comments
Open

[Compose] Code connect, publish function problem #228

thxallgrace opened this issue Dec 19, 2024 · 3 comments

Comments

@thxallgrace
Copy link

thxallgrace commented Dec 19, 2024

Please provide:

Code Connect CLI version: 1.2.4
Code Connect lib: 1.1.3
Code Connect Plugin lib: 1.2.1
Kotlin Gradle Plugin: 2.0.21

figma.config.json (I input this file in app directiory)

{
  "codeConnect": {
    "include": ["src/main/**"],
    "exclude": ["src/androidTest/**", "src/test/**", "build/**"],
    "parser": "compose",
    "gradleWrapperPath": "../gradlew"
  }
}

Issue

npx figma connect --token="{PERSONAL_ACCESS_TOKEN}" --verbose
 Welcome to Code Connect  ~~

Config file found, parsing {path}/app using specified include globs

✔ What is the URL of the Figma file containing design components you'd like to connect? … https://www.figma.com/design/~~
  Fetching component information from https://api.figma.com/v1/code_connect/{FIILE_KEY}/cli_data

Error returned from parser: Parser exited with code 1. Try re-running the command with --verbose for more information.

I got this error when I try to connect figma without detailed error reason. Do you have any solution about this?
And I want to try connect and select component without interactive setup.
Is there any way to connect figma with single line command ?

Oh, I have a extra question.
Why tmp directory is created automatically? It seems that made it whenever i try to connect figma, I think.
In my case, tmp directory made in app directory. (app/tmp)

Thanks

@slees-figma
Copy link

Hey @thxallgrace! Thanks for the report. Would you mind rerunning it with --verbose? That should give us a bit more info to help track down the issue.

You can connect a single component with npx figma connect create "{URL of Figma component}" --token=PERSONAL_ACCESS_TOKEN. That command also works with --verbose and might be easier to run!

We do create a tmp directory to send data between the node + Kotlin code, but we should be cleaning up this directory. Will take a look.

@thxallgrace
Copy link
Author

Hello @slees-figma! Thank you for your quick feedback!
As I input the command line, I already used the --verbose option.
The full command line I used is: npx figma connect --token="{PERSONAL_ACCESS_TOKEN}" --verbose
Even though I used this option, I couldn't get any detailed error description at all.

@slees-figma
Copy link

Thanks @thxallgrace, I've tried running npx figma connect publish with your same lib/plugin versions and not able to repro.

It might be worth trying out npx figma connect publish on a very basic composable (you can either run the command from a directory with just that composable in it, or temporarily change your config include) just to eliminate any concerns that it can't parse your code. Please could you try this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants