jemgold / figma-js

Little wrapper (+ types) for the Figma API
https://jongold.github.io/figma-js/
MIT License
492 stars 47 forks source link

Call for maintainers #67

Open jemgold opened 11 months ago

jemgold commented 11 months ago

Hi y'all - I totally missed a ton of issues & PRs, I didn't think ppl were using this!

Would love to add some more people as maintainers - lmk if you're interested <3

anselmdk commented 11 months ago

As mentioned in https://github.com/jemgold/figma-js/pull/66 I'm happy to help out 😊

jemgold commented 11 months ago

@chrisdrackett any chance we could get a release of #66? Trying to spin up @anselmdk as a maintainer; I forgot that you had ownership of the npm package ❤️

(also potentially do you wanna give him npm permissions?)

chrisdrackett commented 11 months ago

I'll see what I can do on a release, I would need to remember the process as it has been a while. In the meantime I can share the NPM load asap.

(@jemgold I think you are still a maintainer as well)

chrisdrackett commented 11 months ago

@anselmdk what is your npm username?

anselmdk commented 11 months ago

@chrisdrackett it's https://www.npmjs.com/~anselmdk

chrisdrackett commented 11 months ago

added!

anselmdk commented 11 months ago

@chrisdrackett awesome, thanks! I guess It's basically running yarn release (see https://github.com/jemgold/figma-js/blob/main/package.json#L37) @jemgold if you add me as a maintainer (write permissions) to the GitHub repo, I could give it a shot!

chrisdrackett commented 11 months ago

if I remember you might have to run prepare-release first.. its been a while. I might be able to get on my computer later today, but at the moment I'm phone only

anselmdk commented 11 months ago

prepare-release should be part of running yarn release. yarn release runs the following: yarn prepare-release && yarn publish && git push && git push --tag

anselmdk commented 10 months ago

@jemgold / @chrisdrackett I'd be happy to give it a try, I'd just need one of you to give me write access to the GitHub repo.

jfsiii commented 8 months ago

Pinging @jemgold & @chrisdrackett re: @anselmdk's requests for help getting a new npm version published

chrisdrackett commented 8 months ago

I don't have any permissions so I think this is fully on @jemgold

jemgold commented 8 months ago

missed these notifications, sorry! invited @anselmdk, lmk if there's anything else you need. you have npm access right?

feel free to go wild and do whatever you want with this repo @anselmdk! also i'm open if there's a community organization we could transfer this repo to (maybe even just figma? cc @rogie @jordansinger etc) - i'm not working in tech anymore so i'm very rarely on github or checking the associated inboxes

anselmdk commented 8 months ago

I can confirm I now have write access and also npm access, thanks @jemgold and @chrisdrackett! I'll try giving it a shot releasing a new version over the weekend.

anselmdk commented 8 months ago

Okay, so I just published a pre-release. I hope I did everything well, I apologize in advance, as I've never published anything using yarn before. Also it seems the last publishing has been done on yarn 1.x where the current version of yarn is on 4.x. I used the latest version of yarn.

Once we can confirm everything works, I propose to clean up dependencies and streamline the release process. For now I've created the following commit and published the pre-release to npm: https://www.npmjs.com/package/figma-js/v/1.16.1-0

It seems that this is how yarn creates pre-releases, I hope it's not being picked up yet by anyone installing figma-js.

This is what I did to make it work:

#logging into npm
yarn npm login

#creating the pre-release
yarn version prerelease

#running the release
yarn release

#committing and pushing changes
git commit
git tag v1.16.1-0
git push --tag

I'd love for someone to try installing 1.16.1-0 and see if it works. If that's the case, I'll publish an actual release. Probably 1.17.0. I actually wanted to create a pre-release for it, but couln't figure out how to do that using yarn.

jfsiii commented 6 months ago

@anselmdk It's hard to be 💯 sure, but I believe this worked!

I updated the two places a dependency used figma-js to the new 1.16.1-0, and re-ran npm install. That updated the axios from ^0.21.0 to ^1.6.0. I then re-ran the scripts which use the affected dependency and everything worked as expected

here's the changed package-lock.json
diff --git a/package-lock.json b/package-lock.json
index a870848a..77f20409 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3831,7 +3831,7 @@
       "dependencies": {
         "@figma-export/types": "^4.8.0",
         "axios": "^1.6.7",
-        "figma-js": "~1.16.0",
+        "figma-js": "1.16.1-0",
         "p-limit": "^3.1.0",
         "p-retry": "^4.6.2"
       },
@@ -3904,7 +3904,7 @@
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "figma-js": "~1.16.0"
+        "figma-js": "1.16.1-0"
       },
       "engines": {
         "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -16308,24 +16308,17 @@
       "license": "MIT"
     },
     "node_modules/figma-js": {
-      "version": "1.16.0",
+      "version": "1.16.1-0",
+      "resolved": "https://registry.npmjs.org/figma-js/-/figma-js-1.16.1-0.tgz",
+      "integrity": "sha512-4yA1PJOAnFBp8V26nEikzsBz4E6KZtdIGg6EMiqnFr2x5x2ehZy70MadFQOc/wnyPDvorqvN6eH8b7IfmUqIRQ==",
       "dev": true,
-      "license": "MIT",
       "dependencies": {
-        "axios": "^0.21.1"
+        "axios": "^1.6.0"
       },
       "engines": {
         "node": ">=8.9"
       }
     },
-    "node_modules/figma-js/node_modules/axios": {
-      "version": "0.21.4",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "follow-redirects": "^1.14.0"
-      }
-    },
     "node_modules/figures": {
       "version": "3.2.0",
       "license": "MIT",

Sidnioulz commented 3 weeks ago

@jemgold I can't begin to say how appreciative I am of your project. It was my first API client for Figma. It's so much work implementing APIs by hand.

Figma have published an OpenAPI spec that can now be used to generate client code and keep it up-to-date with no manual intervention. The spec is on at https://github.com/figma/rest-api-spec. It's not super easy to use due to the way it's published (see https://github.com/figma/rest-api-spec/issues/18), but I have used it to create my own client and I have working code to automatically update the client code and publish to NPM via dependabot. Feel free to copy my code and ask if you'd like to replicate that in figma-js.


Be also aware that Figma are deprecating some API endpoints and auth methods soon:

We’re updating Figma’s REST API to be more secure and fully comply with the OAuth 2.0 standard. Because of this, REST API apps making calls to our OAuth endpoints need to make a few updates by February 24, 2025 to continue calling the REST API.

Please follow these steps to update your app:

Send OAuth credentials in the request header Currently, most apps send OAuth credentials as parameters in the request. Going forward, your app should send OAuth details in the Authorization header of the request using the Basic scheme. Use the new API base URL structure Currently, most apps access Figma's OAuth APIs using the base route https://www.figma.com/api/. Going forward, your app should use https://api.figma.com/v1/ to call Figma’s OAuth APIs.

We've created a migration guide to walk you through these steps in detail. Thanks in advance!


Ultimately, if you find that you don't have time to maintain figma-js, please consider deprecating the package on NPM so that users know to look for up-to-date clients. You could also encourage Figma to publish a client themselves alongside their spec, and your voice might have more weight considering how popular your own client is.

Thanks!

chrisdrackett commented 3 weeks ago

@Sidnioulz would you like to be a maintainer here to help out?

Sidnioulz commented 3 weeks ago

@chrisdrackett happy to lend a hand with OpenAPI codegen, though, I'm not sure I want to maintain an extra project, as I maintain my own REST client already and have several ongoing projects. I'd like to contribute in a capacity that does not involve recurring work :sweat_smile:

Happy to have a chat about it, though. Are there other people who are currently willing to put in hours in figma-js?

jemgold commented 3 weeks ago

💖💖 thanks for the updates - i haven’t been tracking this project or the figma API for a while. i’m down to do whatever the community feels is best - would it break a lot of things if we deprecated this package?

On Sat, Nov 2, 2024 at 10:39 AM, Steve Dodier-Lazaro @.***(mailto:On Sat, Nov 2, 2024 at 10:39 AM, Steve Dodier-Lazaro < wrote:

@.***(https://github.com/chrisdrackett) happy to lend a hand with OpenAPI codegen, though, I'm not sure I want to maintain an extra project, as I maintain my own REST client already and have several ongoing projects. I'd like to contribute in a capacity that does not involve recurring work 😅

Happy to have a chat about it, though. Are there other people who are currently willing to put in hours in figma-js?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

Sidnioulz commented 3 weeks ago

Deprecating in NPM does not break things. People can continue to use the deprecated package, but they get a warning and you can show a message with alternative options. See https://docs.npmjs.com/deprecating-and-undeprecating-packages-or-package-versions.

Now that Figma request versioned APIs, all codegen tools would give you methods like v1.getFiles or v1GetFiles, so you'd need an extra investment in codegen to produce an API that matches the names you currently have. You would also likely have breaking changes in TypeScript types. So, if you do adopt codegen and continue to maintain figma-js, you would probably need to release a major version.

I started my own client because I realised some endpoints around variables were missing for a project I had, and I didn't have the courage to manually scour through the Figma API and find missing methods to offer a PR.

I found it easier to start from a clean slate, and codegen tools are all or nothing; it takea a lot more work to map the API to an existing coding style than to delegate the naming of methods and parameters to the codegen tool.

There are a few folks on this thread who were kind enough to offer to help with maintenance. I suppose they are the best placed to answer the question of how to proceed :)