GithubHelp home page GithubHelp logo

theemo-tokens / theemo Goto Github PK

View Code? Open in Web Editor NEW
26.0 3.0 2.0 10.52 MB

Design Token Automations

Home Page: https://theemo.io

JavaScript 9.37% TypeScript 90.63%
design-tokens automation figma style-dictionary design-ops

theemo's People

Contributors

dependabot[bot] avatar gossi avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

theemo's Issues

Re-enable tests

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.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • Replace dependency read-pkg-up with read-package-up ^11.0.0

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • wyvox/action v1
  • wyvox/action v1
.github/workflows/coverage.yml
  • wyvox/action v1
  • paambaati/codeclimate-action v5.0.0
npm
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

  • Check this box to trigger a request for Renovate to run again on this repository

Architectural Changes

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 dictionary

to better reason about the code and keep things isolated.

Can't make theemo plugin to work with jsonbin

Hi! It looks like export to jsonbin.io stopped working.

I'm following the steps described on the support page:

  1. Enter credentials in settings
    a. Create an account and copy the API Key - ✅
    b. Create a bin and copy the bin URL - it is impossible to create an empty bin

image

So I just added some dummy parameters to just create that bin

image

Now I can get bin URL ✅

I put API key and bin URL on the settings page in plugin and hit save:
image
2. On the tools tab the Export Settings button becomes available. Clicking the button will export your references. - following the instruction:
image

Next, I check if the bin was updated with data from the plugin:
image
Looks like the bin didn't get updates🤷‍♂️

Can you please help me with it?

Can't make theemo plugin to work with jsonbin

Hi! It looks like export to jsonbin.io stopped working.

I'm following the steps described on the support page:

  1. Enter credentials in settings
    a. Create an account and copy the API Key - ✅
    b. Create a bin and copy the bin URL - it is impossible to create an empty bin

image

So I just added some dummy parameters to just create that bin

image

Now I can get bin URL ✅

I put API key and bin URL on the settings page in plugin and hit save:
image
2. On the tools tab the Export Settings button becomes available. Clicking the button will export your references. - following the instruction:
image

Next, I check if the bin was updated with data from the plugin:
image
Looks like the bin didn't get updates🤷‍♂️

Can you please help me with it?

Action Required: Fix Renovate Configuration

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)

Can't access value from node

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: ''
    },

Is it possibile add multiple figma files / bins to theemo.js?

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' } } },

Sync Variables

In @theemo/figma make it understand Variables as exported from theemo-tokens/figma-theemo#56

... and export them as tokens.

For @theemo/figma:

  • Variables module:
    • Parses tokens from objects of Variable
  • Uses module to read the /variables endpoint (when using enterprise plan)
  • Define hooks for the config to parse and understand variables

For @theemo/figma -> theemo plugin:

  • Define Plugin API for @theemo/figma
  • theemo plugin
    • Uses variable module to handle variables exposed from theemo figma plugin
    • Read references from theemo as of .theemo/config -> styles
    • Read transforms from theemo as of .theemo/config -> variables

For @theemo/style-dictionary:

  • Handle transforms in @theemo/style-dictionary

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.