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

Work on implementing code connect to allow for realistic code preview in figma #4545

Merged
merged 15 commits into from
May 28, 2024

Conversation

lukasoppermann
Copy link
Contributor

@lukasoppermann lukasoppermann commented Apr 30, 2024

Changelog

  • adds figma code connect files for some componenrts
  • adds figma.config.json form code connect config
  • adds deps and script to packages/react/package.json
  • adds action to run code connect whenever a .figma.tsx file is changed
  • adds script to generate code connect for icons

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

No effect on package output, just for figma, but it can't be version within figma.

Testing & Reviewing

Merge checklist

@lukasoppermann lukasoppermann added design skip changeset This change does not need a changelog labels Apr 30, 2024
@lukasoppermann lukasoppermann self-assigned this Apr 30, 2024
Copy link

changeset-bot bot commented Apr 30, 2024

⚠️ No Changeset found

Latest commit: dccdcc1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Apr 30, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 89.34 KB (0%)
packages/react/dist/browser.umd.js 89.68 KB (0%)

Copy link
Member

@joshblack joshblack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @lukasoppermann! Just left some questions 👀

.github/workflows/figma_connect_publish.yml Show resolved Hide resolved
.github/workflows/figma_connect_publish.yml Show resolved Hide resolved
"exclude": ["test/**", "docs/**", "build/**"],
"react": {
"importPaths": {
"./src/*": "@primer/react"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this also work for drafts/experimental/deprecated or do we need to special case those?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, I'd need to test it.

packages/react/package.json Outdated Show resolved Hide resolved
packages/react/src/Avatar/Avatar.figma.tsx Show resolved Hide resolved
@@ -15,6 +15,7 @@
"src/utils/story-helpers.tsx",
"**/*.stories.tsx",
"**/*.test.tsx",
"**/*.figma.tsx",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukasoppermann what are you looking for it to be ignored from? Pulled it down real quick and it seemed to be ignored from the build but just wanted to check-in to make sure I knew what you were looking to do 👀

@@ -10,6 +10,7 @@
"src/**/*.js",
"src/**/*.ts",
"src/**/*.tsx",
"!src/**/*.figma.tsx",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if I'm misunderstanding, it seems like we would want this in our type-check task for CI to make sure that figma connect files are generated correctly but we would not want it in our package files, is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think neither.

  • def. not in package file
  • there are some issues with making it typescript compliant as it is "read as text", this is why I should probably also not be checked.

Happy to jump on a pairing session to see if there is some way around ignoring it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukasoppermann sounds great, would love to pair up on it if you have the time!

@lukasoppermann lukasoppermann added this pull request to the merge queue May 28, 2024
Merged via the queue into main with commit 2b22017 May 28, 2024
30 checks passed
@lukasoppermann lukasoppermann deleted the figmaDevMode branch May 28, 2024 13:31
khiga8 pushed a commit that referenced this pull request May 31, 2024
… in figma (#4545)

* Work on implementing code connect

* adding config

* fixing lint issues

* fix for type issue

* fix some icons

* fixes for button and adding Link component

* add as property to branchname

* rm figma:sync script

* chore: fix typescript issues in Button.figma for code connect

* chore: fix typo

* chore: add nocheck for button and generate Octicon figma file

* chore: add notice to generated file

* fix icons

---------

Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design skip changeset This change does not need a changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants