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

Automate Figma documentation #404

Merged
merged 31 commits into from Apr 13, 2023
Merged

Automate Figma documentation #404

merged 31 commits into from Apr 13, 2023

Conversation

lukasoppermann
Copy link
Contributor

@lukasoppermann lukasoppermann commented Feb 23, 2023

This is the very beginning of adding figma to the new docs.

👀 Preview

Changes

  • removes figmaUrl and replaced with figmaId
  • store figma data in graphQL
  • provide data to components through props

Todo

  • currently data is loaded in the components from an npm module, this should be replaced so that it is available via gatsby @josepmartins @danielguillan can you do this?
  • currently component.thumbnails.prop is an object with dynamic props. We should replace this with an array of entries ['propertyName', 'propertyValue'] so that it is graphQL compatible @danielguillan @josepmartins
  • some components, like actionList are not available. I think this may be, because it is not a component set CC: @danielguillan?
  • Pictures don't show up, this is either figma and they are gone, or an issue with access rights / cors, etc. @colebemis any idea?
  • individual properties should be added automatically, we need to have a list of all properties in gatsby to loop over the props and add the components.
  • somehow the anchor nav does not show up
  • fix inconsistent spacing below headlines
  • images don't show up
  • we should probably remove the last edited by section in the overview, right?
  • spacing in overview (to section below yellow note) should be adjusted to fit to react page
  • components should be cleaned up and named better.

@emilybrick
Copy link
Contributor

Thank you for taking this on @lukasoppermann ! 👏 🙏 so excited to have all component docs in one place.

Questions about task list, what do these two refer to?

  • spacing in overview (to section below yellow note) should be adjusted to fit to react page
  • components should be cleaned up and named better.

@lukasoppermann
Copy link
Contributor Author

lukasoppermann commented Feb 23, 2023

  • spacing in overview (to section below yellow note) should be adjusted to fit to react page

This is partially improved. It is the spacing between the badge and the variants at the very top

  • components should be cleaned up and named better.

This is just how the figma react components are named and build

@lukasoppermann lukasoppermann marked this pull request as ready for review February 24, 2023 11:50
@lukasoppermann lukasoppermann requested a review from a team as a code owner February 24, 2023 11:50
@lukasoppermann lukasoppermann temporarily deployed to github-pages February 24, 2023 12:36 — with GitHub Actions Inactive
@colebemis
Copy link
Contributor

@lukasoppermann The image issue looks like a permissions problem:

CleanShot 2023-02-28 at 18 33 35@2x

Where you and @josepmartins able to get the images working in another prototype?

@lukasoppermann
Copy link
Contributor Author

@lukasoppermann The image issue looks like a permissions problem:

CleanShot 2023-02-28 at 18 33 35@2x

This is actually normal for figma images. They don't allow browser get somehow. It used to work here: https://primer-af96a7b598-26441320.drafts.github.io/guides/figma/components/banner

But it is broken there to. I think @josepmartins and @danielguillan will have a look once josep is back from his vacation.

@lukasoppermann lukasoppermann temporarily deployed to github-pages March 10, 2023 22:43 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages March 29, 2023 11:39 — with GitHub Actions Inactive
josepmartins and others added 4 commits March 31, 2023 11:16
Co-authored-by: Daniel Guillan <danielguillan@github.com>
Co-authored-by: Daniel Guillan <danielguillan@github.com>
@josepmartins josepmartins temporarily deployed to github-pages March 31, 2023 11:07 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages April 3, 2023 11:15 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages April 3, 2023 14:56 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages April 3, 2023 16:27 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages April 4, 2023 14:35 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages April 5, 2023 06:55 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages April 5, 2023 11:17 — with GitHub Actions Inactive
@josepmartins josepmartins temporarily deployed to github-pages April 5, 2023 16:40 — with GitHub Actions Inactive
Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

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

This looks amazing! 🚀

async function sourceFigmaData({actions, createNodeId, createContentDigest}) {
// Save the Primer Figma data to the GraphQL store
const json = await fetch(
`https://raw.githubusercontent.com/primer/figma/main/packages/web/generated/components.json`,
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this data get updated?

Copy link
Contributor

Choose a reason for hiding this comment

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

We've set up a workflow that updates the JSON file daily (can be triggered on demand too). Also, we're planning to hook it up to the Figma library release process that is being worked on, so it's also triggered automatically when a new release is published.

src/components/FigmaComponentPlayground.js Outdated Show resolved Hide resolved
@josepmartins josepmartins merged commit a81c2f0 into main Apr 13, 2023
4 checks passed
@josepmartins josepmartins deleted the new-IA-figma branch April 13, 2023 10:29
@josepmartins josepmartins mentioned this pull request Apr 25, 2023
4 tasks
@josepmartins josepmartins changed the title Automate figma documentation Automate Figma documentation May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants