Skip to content

Commit

Permalink
Fix: Themes data
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Oct 11, 2024
1 parent e8f6b92 commit f50a359
Show file tree
Hide file tree
Showing 3 changed files with 261 additions and 9 deletions.
6 changes: 5 additions & 1 deletion exporters/variables-scss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"test:unit": "jest",
"test:unit:watch": "yarn test:unit --watchAll",
"test:unit:coverage": "yarn test:unit --coverage",
"types": "true"
"types": "true",
"test-tokens": "tsx ./src/compute-tokens-by-applying-themes.ts"
},
"dependencies": {
"@supernovaio/export-helpers": "^1.0.9",
Expand All @@ -25,13 +26,16 @@
},
"devDependencies": {
"@lmc-eu/eslint-config-typescript": "2.1.4",
"@supernovaio/sdk": "^2.0.22",
"@supernovaio/supernova-sdk": "^1.9.33",
"@swc/core": "1.7.26",
"@swc/jest": "0.2.36",
"eslint": "8.57.0",
"jest": "29.7.0",
"jest-config-spirit": "workspace:^",
"npm-run-all": "4.1.5",
"prettier-config-spirit": "workspace:^",
"tsx": "^4.19.1",
"typescript": "5.6.2"
}
}
16 changes: 16 additions & 0 deletions exporters/variables-scss/src/compute-tokens-by-applying-themes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import SupernovaSDK from '@supernovaio/sdk';
import { themesData } from './data/themes-data';
import { tokensDataBckp } from './data/tokens-data-bckp';

const apiKey = '';
const sdk = new SupernovaSDK.Supernova(apiKey);

const allThemes = await Promise.all(
themesData.map(async (theme) => {
const themedTokens = await sdk.tokens.computeTokensByApplyingThemes(tokensDataBckp, [theme]);

return { themedTokens, theme };
}),
);

console.log(allThemes);
Loading

0 comments on commit f50a359

Please sign in to comment.