@design-sync/manager
v0.6.3
Published
Plugable design tokens manager
Downloads
111
Readme
@design-sync/manager
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.