Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@design-sync/manager

npm version npm downloads

Plugable design tokens manager

Usage

Install package:

# npm
npm install @design-sync/manager

# yarn
yarn add @design-sync/manager

# pnpm
pnpm install @design-sync/manager

# bun
bun install @design-sync/manager

Usage:

import { TokensManager } from '@design-sync/manager'

const tokensManager = new TokensManager();
tokensManager.use({
  name: 'my-plugin',
  build: async (manager) => {
    const walker = manager.getWalker();
    walker.walk((token) => {
      // do something with token
    });

    return [{
     name: 'my-plugin-emitted-file.css',
     content: 'transformed tokens or whatever',
    }];
  },
});
// what will happen? 
// 1. resolve config from .design-sync.config file in current working directory or user home directory
// 2. override config with the provided config
// 3. fetch tokens from the provided uri or use the provided tokens
// 4. run plugins
// 5. write emitted files to disk
await tokensManager.run({
  // override config
  uri: 'gh:owner/repo#branch',
});
console.log("done");

Development

  • Clone this repository
  • Install latest LTS version of Node.js
  • Enable Corepack using corepack enable
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

Made with 💛

Published under MIT License.