-
Notifications
You must be signed in to change notification settings - Fork 1
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 #3 from Design-System-Project/feature/tfr2-102-fig…
…ma-variables-to-style-dictionary draft of figma converter
- Loading branch information
Showing
57 changed files
with
1,611 additions
and
556 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
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
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 |
---|---|---|
|
@@ -21,5 +21,11 @@ | |
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": "^20" | ||
}, | ||
"pnpm": { | ||
"overrides": { | ||
"@trpc/client": "11.0.0-rc.482", | ||
"@trpc/server": "11.0.0-rc.482" | ||
} | ||
} | ||
} |
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,47 @@ | ||
import { getInstallationOctokit, pushFile } from '@ds-project/services/github'; | ||
import { selectGithubIntegration } from '../queries/integrations'; | ||
import type { DSContext } from '../types/context'; | ||
import type { DesignTokensModel } from '@ds-project/database/schema'; | ||
|
||
export async function release({ | ||
ctx, | ||
designTokens, | ||
}: { | ||
ctx: DSContext; | ||
designTokens: DesignTokensModel | null; | ||
}) { | ||
const githubIntegration = await selectGithubIntegration({ ctx }); | ||
|
||
if (!githubIntegration) { | ||
console.log('No GitHub integration found. Skipping release.'); | ||
return; | ||
} | ||
|
||
const octokit = await getInstallationOctokit( | ||
githubIntegration.data.installationId | ||
); | ||
|
||
const repositories = await octokit.request('GET /installation/repositories'); | ||
const repository = repositories.data.repositories.find( | ||
(_repository) => _repository.id === githubIntegration.data.repositoryId | ||
); | ||
|
||
if (!repository) { | ||
console.log('No repository found. Skipping release.'); | ||
return; | ||
} | ||
|
||
const content = btoa(JSON.stringify(designTokens, null, 2)); | ||
|
||
await pushFile({ | ||
file: { | ||
content, | ||
encoding: 'base64', | ||
name: 'tokens.json', | ||
path: 'packages/generator/tokens', | ||
}, | ||
installationId: githubIntegration.data.installationId, | ||
owner: repository.owner.login, | ||
repo: repository.name, | ||
}); | ||
} |
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
Oops, something went wrong.