theemo-tokens / theemo Goto Github PK
View Code? Open in Web Editor NEWDesign Token Automations
Home Page: https://theemo.io
Design Token Automations
Home Page: https://theemo.io
Make the parser public, it is lacking an export.
As part of #689 I deactivated a couple of tests, since the test-setup with fixtures had cyclic dependencies.
This needs to be reworked as part of this ticket and make tests available again through vitest.
Somewhen during development - I thought - it was possible to run vitest wo/ having the code build
before. As part of this ticket, investigate, if bringing back vite
to each ticket (with its config), it can run tests wo/ them being built by tsup
.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are pending. To force PRs open, click the checkbox below.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@typescript-eslint/eslint-plugin
, @typescript-eslint/parser
).github/workflows/ci.yml
wyvox/action v1
wyvox/action v1
.github/workflows/coverage.yml
wyvox/action v1
paambaati/codeclimate-action v5.0.0
package.json
@release-it-plugins/lerna-changelog ^6.1.0
@release-it-plugins/workspaces ^4.2.0
@vitest/coverage-v8 ^1.0.0
@vitest/ui ^1.0.0
concurrently ^8.2.0
release-it ^17.0.1
turbo ^1.10.14
typedoc ^0.25.7
typedoc-plugin-markdown ^4.0.0-next.42
typedoc-vitepress-theme ^1.0.0-next.7
vitest ^1.0.0
@zvitek/vitepress-plugin-matomo ^1.0.1
markdown-it-attrs ^4.1.6
markdown-it-deflist ^3.0.0
markdown-it-multimd-table ^4.2.3
mermaid ^10.6.1
vite ^5.0.10
vitepress 1.0.0-rc.44
vitepress-plugin-mermaid ^2.0.16
vue ^3.4.3
node 20.11.1
packages/@theemo/build/package.json
read-pkg ^9.0.0
@gossi/config-eslint ^0.7.0
@gossi/config-prettier ^0.7.0
@types/node ^20.6.3
concurrently ^8.2.0
eslint ^8.49.0
prettier ^3.0.3
tsup ^8.0.0
typescript ^5.2.2
vitest ^1.0.0
packages/@theemo/cli/package.json
@theemo/build 0.2.2
@theemo/sync 0.2.2
commander ^12.0.0
cosmiconfig ^9.0.0
dotenv ^16.3.1
read-pkg-up ^11.0.0
esm ^3.2.25
@gossi/config-eslint ^0.7.0
@gossi/config-prettier ^0.7.0
@swc/cli ^0.3.0
@swc/core ^1.3.67
@types/node ^20.3.3
concurrently ^8.2.0
eslint ^8.49.0
prettier ^3.0.3
tsup ^8.0.0
typescript ^5.2.2
vitest ^1.0.0
packages/@theemo/core/package.json
@gossi/config-eslint ^0.7.0
@gossi/config-prettier ^0.7.0
concurrently ^8.2.0
eslint ^8.49.0
prettier ^3.0.3
tsup ^8.0.0
typescript ^5.2.2
vitest ^1.0.0
packages/@theemo/figma/package.json
@theemo/tokens 0.2.2
@theemo/sync 0.2.2
colord ^2.9.3
figma-api ^1.11.0
lodash.isempty ^4.4.0
lodash.merge ^4.6.2
@babel/core ^7.22.5
@babel/eslint-parser ^7.22.5
@gossi/config-eslint ^0.7.0
@gossi/config-prettier ^0.7.0
@types/lodash.isempty ^4.4.7
@types/lodash.merge ^4.6.7
@typescript-eslint/eslint-plugin ^5.60.1
@typescript-eslint/parser ^5.60.1
concurrently ^8.2.0
eslint ^8.49.0
prettier ^3.0.3
tsup ^8.0.0
typescript ^5.2.2
vitest ^1.0.0
packages/@theemo/style-dictionary/package.json
@theemo/tokens 0.2.2
@theemo/sync 0.2.2
@gossi/config-eslint ^0.7.0
@gossi/config-prettier ^0.7.0
@types/jsonpath ^0.2.0
@types/mock-fs ^4.13.1
concurrently ^8.2.0
eslint ^8.49.0
jsonpath ^1.1.1
mock-fs ^5.2.0
prettier ^3.0.3
style-dictionary ^3.8.0
tsup ^8.0.0
typescript ^5.2.2
vitest ^1.0.0
style-dictionary >= 3
packages/@theemo/sync/package.json
@theemo/tokens 0.2.2
@babel/core ^7.22.5
@babel/eslint-parser ^7.22.5
@gossi/config-eslint ^0.7.0
@gossi/config-prettier ^0.7.0
@typescript-eslint/eslint-plugin ^5.60.1
@typescript-eslint/parser ^5.60.1
concurrently ^8.2.0
eslint ^8.49.0
prettier ^3.0.3
tsup ^8.0.0
typescript ^5.2.2
vitest ^1.0.0
packages/@theemo/theme/package.json
type-fest ^4.0.0
@babel/core ^7.22.5
@gossi/config-eslint ^0.7.0
@gossi/config-prettier ^0.7.0
@swc/cli ^0.3.0
@swc/core ^1.3.67
concurrently ^8.2.0
eslint ^8.49.0
prettier ^3.0.3
typescript ^5.2.2
packages/@theemo/tokens/package.json
colord ^2.9.3
lodash.merge ^4.6.2
@gossi/config-eslint ^0.7.0
@gossi/config-prettier ^0.7.0
@types/lodash.merge ^4.6.7
concurrently ^8.2.0
eslint ^8.49.0
prettier ^3.0.3
tsup ^8.0.0
typescript ^5.2.2
vitest ^1.0.0
testing/fixtures/package.json
pkg-dir ^8.0.0
@gossi/config-eslint ^0.7.0
@gossi/config-prettier ^0.7.0
@swc/cli ^0.3.0
@swc/core ^1.3.67
@types/node ^20.4.0
concurrently ^8.2.0
eslint ^8.44.0
prettier ^3.0.0
typescript ^5.1.6
testing/playground-theme/package.json
style-dictionary ^3.8.0
themes/super-theemo/package.json
npm-run-all2 ^6.0.0
style-dictionary ^3.7.0
theemo ^0.1.0
Add this feature as a plugin, which uses the existing functions to extract variables into tokens.
Put this behind a configuration option.
See:
Currently when syncing tokens, there is a one-to-one mapping of "node" to token. However for composite tokens this is a one-to-many relationship.
The code is sort well structured within src/
. That should be split apart into multiple packages, so that there is:
theemo
, maybe @theemo/cli
(actually only a shim)@theemo/core
- shared and common parts@theemo/sync
- sync from figma to style dictionary@theemo/build
- build a theemo theme@theemo/theme
- theme types and APIs@theemo/figma
- connection to figma@theemo/style-dictionary
- connection to style dictionaryto better reason about the code and keep things isolated.
Hi! It looks like export to jsonbin.io stopped working.
I'm following the steps described on the support page:
I put API key and bin URL on the settings page in plugin and hit save:
2. On the tools tab the Export Settings button becomes available. Clicking the button will export your references. - following the instruction:
Next, I check if the bin was updated with data from the plugin:
Looks like the bin didn't get updates🤷♂️
Can you please help me with it?
Hi! It looks like export to jsonbin.io stopped working.
I'm following the steps described on the support page:
I put API key and bin URL on the settings page in plugin and hit save:
2. On the tools tab the Export Settings button becomes available. Clicking the button will export your references. - following the instruction:
Next, I check if the bin was updated with data from the plugin:
Looks like the bin didn't get updates🤷♂️
Can you please help me with it?
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)
Any plan to add the ability to reference text styles? Would be a great feature!
It seems like I can access values with getValue()
within another function inside of reader. I want to ensure that the value is included in the output, as expected in the output for this step, right?
import { getValue, getTypefromStyle } from 'theemo/dist/tools/figma/token.js';
getTypeFromToken: (token) => {
if (token.style) {
console.log(getValue(token, {})); // ok can get colors
return getTypefromStyle(token.style);
}
return '';
},
Hi, I'm not sure I fully understand theemo. But I have nodes. And I would expect to have values too. However, I don't see how values are extracted.
I've looked in https://theemo.io/cli/sync/reader
https://theemo.io/cli/sync/reader#output
export default {
sync: {
reader: {
tool: 'figma',
figmaFile: FIGMA_FILE_ID,
figmaSecret: FIGMA_SECRET,
// referencer
referencer: {
type: 'figma-plugin',
plugin: 'theemo',
pluginConfig: {
jsonbinFile: JSONBIN_FILE_ID,
jsonbinSecret: JSONBIN_SECRET,
formats: {
color: 'hex',
colorAlpha: 'rgb',
},
},
},
getValueFromText(node) {
console.log(node); // I'd expect to see something here as well https://theemo.io/cli/sync/reader#getvaluefromtext
return node;
},
getPropertiesForToken: (token, document) => {
console.log(document);
if (token.figmaName) {
return {
figmaName: token.figmaName,
};
}
},
},
writer: {
tool: 'style-dictionary',
},
},
};
output
'143:1637': {
key: 'd54ed81ff7b55f52427f0ce4194cad53031faf23',
name: '.reference/accent/purple/20',
styleType: 'FILL',
remote: false,
description: ''
},
'143:1638': {
key: 'e5ee131b9336f5e805dec61889a31ec2f39a6029',
name: '.reference/accent/purple/30',
styleType: 'FILL',
remote: false,
description: ''
},
'143:1639': {
key: '88fbb355e39c54dca51519ffc371d816a90a4943',
name: '.reference/accent/purple/40',
styleType: 'FILL',
remote: false,
description: ''
},
'143:1640': {
key: '4739abc0e5fb6f254c3e4b3c384ff120cf79aec7',
name: '.reference/accent/purple/50',
styleType: 'FILL',
remote: false,
description: ''
},
'143:1641': {
key: 'c542f4a9003f767de0375d7776abecdbb693b6c7',
name: '.reference/accent/purple/60',
styleType: 'FILL',
remote: false,
description: ''
},
'143:1642': {
key: '1293f4f69be54cfcfa1d205d4490db13a189da8e',
name: '.reference/accent/purple/70',
styleType: 'FILL',
remote: false,
description: ''
},
'143:1643': {
key: 'da2076041b7b1d9b8d41810efcd70abdc9870217',
name: '.reference/accent/purple/80',
styleType: 'FILL',
remote: false,
description: ''
},
'143:1644': {
key: '773574811326f26b0ed14cf3da5b049cfc5abf61',
name: '.reference/accent/purple/90',
styleType: 'FILL',
remote: false,
description: ''
},
'147:1655': {
key: '231a00f883677e5fc05483445b0926b2b89c7202',
name: 'semantic/content/validation/success',
styleType: 'FILL',
remote: false,
description: ''
},
'147:1666': {
key: 'f9330b6a9cb2ee7579ff4a4e0ee89e43cddea390',
name: 'semantic/content/validation/failure',
styleType: 'FILL',
remote: false,
description: ''
},
'147:1728': {
key: 'f5fc1c55e4c9eaa84a6bd35eddff701f1519030d',
name: 'semantic/alert-label/critical',
styleType: 'FILL',
remote: false,
description: ''
},
'147:1729': {
key: 'f8ac6ba651a516ecf5438021e10e4340340b03bd',
name: 'semantic/alert-label/high',
styleType: 'FILL',
remote: false,
description: ''
},
'147:1730': {
key: 'fc4d48659a5baae97c3deff26673d0e537b36de1',
name: 'semantic/alert-label/medium',
styleType: 'FILL',
remote: false,
description: ''
},
I'm using the Figma plugin to reference color styles and I've got two published libraries: "Styles - Light" and "Styles - Dark". I switch between color modes using the "Swap Library" feature and almost everything works flawlessly.
I've been exporting and converting tokens with a 100% custom script, and I recently wanted to go deep with Theemo's CLI, but I can't figure out how to link those files (and their respective JSON bins) into theemo.js
though. Is it actually possible?
sync: { reader: { tool: 'figma', figmaFile: FIGMA_FILE, figmaSecret: FIGMA_SECRET, referencer: { type: 'figma-plugin', plugin: 'theemo', pluginConfig: { jsonbinFile: JSONBIN_FILE, jsonbinSecret: JSONBIN_SECRET, formats: { color: 'hex', colorAlpha: 'rgb' } } },
Make all types public, that are used in the config, e.g. FigmaToken
- some are private.
In this line:
if a value is 0
, the expression evaluates to false
. It must be checked against undefined
.
In @theemo/figma
make it understand Variables as exported from theemo-tokens/figma-theemo#56
... and export them as tokens.
For @theemo/figma
:
Variable
/variables
endpoint (when using enterprise plan)For @theemo/figma
-> theemo
plugin:
@theemo/figma
theemo
plugin
variable
module to handle variables exposed from theemo figma plugintheemo
as of .theemo/config
-> styles
theemo
as of .theemo/config
-> variables
For @theemo/style-dictionary
:
@theemo/style-dictionary
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.