-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from ZebraDevs/code-connect
feat: Added code connect integration for Figma
- Loading branch information
Showing
45 changed files
with
6,982 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: "Create Code Connect" | ||
description: "Generate code connect files" | ||
inputs: | ||
figma-access-token: | ||
description: "The personal access token given by Figma. Required to make API calls" | ||
required: true | ||
|
||
runs: | ||
using: "node20" | ||
main: "index.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { readFileSync } from "fs"; | ||
import { generateCodeConnectFile } from "../../dist/scripts/code-connect/generate-code-connect-file.js"; | ||
|
||
const main = async () => { | ||
const iconManifest = new Map(Object.entries(JSON.parse(readFileSync("../../outputs/icon-manifest.json")))); | ||
const dir = "../../outputs"; | ||
|
||
generateCodeConnectFile(dir, iconManifest); | ||
}; | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: "Publish Code Connect" | ||
description: "Publish code connect files" | ||
inputs: | ||
figma-access-token: | ||
description: "The personal access token given by Figma. Required to make API calls" | ||
required: true | ||
|
||
runs: | ||
using: "node20" | ||
main: "index.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import core from "@actions/core"; | ||
import util from "util"; | ||
import { exec } from "child_process"; | ||
const asyncExec = util.promisify(exec); | ||
|
||
const FIGMA_ACCESS_TOKEN = core.getInput("figma-access-token") || process.env.FIGMA_ACCESS_TOKEN; | ||
|
||
const { stdout, stderr } = await asyncExec(`npx figma connect publish --token ${FIGMA_ACCESS_TOKEN}`, { | ||
cwd: "../..", | ||
}); | ||
|
||
console.log(stdout); | ||
console.error(stderr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"codeConnect": { | ||
"include": ["outputs/code-connect.figma.ts"], | ||
"exclude": ["test/**/*.figma.ts"] | ||
} | ||
} |
Oops, something went wrong.