Skip to content

Commit

Permalink
Work on implementing code connect to allow for realistic code preview…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
lukasoppermann and joshblack authored May 28, 2024
1 parent dde7cef commit 2b22017
Show file tree
Hide file tree
Showing 11 changed files with 3,403 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/figma_connect_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Figma Connect Publish on Change

on:
push:
paths:
- packages/react/src/components/**/*.figma.tsx
branches:
- main

jobs:
code-connect:
name: Code Connect
runs-on: ubuntu-latest
steps:
- run: npx figma connect publish
env:
FIGMA_ACCESS_TOKEN: ${{ secrets.FIGMA_ACCESS_TOKEN }}
285 changes: 282 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions packages/react/figma.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"codeConnect": {
"include": ["src/**/*.figma.tsx", "src/**/*.tsx"],
"exclude": ["test/**", "docs/**", "build/**"],
"react": {
"importPaths": {
"./src/*": "@primer/react"
},
"paths": {}
}
}
}
3 changes: 2 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
"@babel/plugin-transform-modules-commonjs": "7.24.1",
"@babel/preset-react": "7.23.3",
"@babel/preset-typescript": "7.24.1",
"@figma/code-connect": "^0.1.1",
"@primer/css": "^21.0.1",
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-commonjs": "25.0.4",
Expand Down Expand Up @@ -241,4 +242,4 @@
"optional": true
}
}
}
}
Loading

0 comments on commit 2b22017

Please sign in to comment.