Skip to content

Commit

Permalink
docs: token workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdehaven committed Jun 8, 2023
1 parent 6c69d60 commit 0f303bf
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ A **Style Dictionary** is a build system that allows you to define styles once,
- [Usage](#usage)
- [Tokens](#tokens)
- [Token Requirements](#token-requirements)
- [Local Development](#local-development)
- [Updating Tokens \& Local Development](#updating-tokens--local-development)
- [Development Sandbox](#development-sandbox)
- [Lint and fix](#lint-and-fix)
- [Build for production](#build-for-production)
- [Token Update Workflow](#token-update-workflow)
- [Committing Changes](#committing-changes)
- [Package Publishing](#package-publishing)

Expand Down Expand Up @@ -80,7 +81,7 @@ Directory | Description

</details>

## Local Development
## Updating Tokens & Local Development

To get started, install the package dependencies

Expand All @@ -95,7 +96,7 @@ This repository includes a Vue sandbox (see the `/sandbox` directory) to allow y
To start the sandbox:

```sh
yarn run sandbox
yarn sandbox
```

This command will simultaneously start the Vite dev server and initialize a watcher on the `/tokens` directory. If any files in the `/tokens` directory are modified, the sandbox will automatically run the build command to update the tokens and then restart the Vite dev server (simulating hot module reload).
Expand All @@ -108,10 +109,10 @@ Lint package files, and optionally auto-fix detected issues.

```sh
# Lint only
yarn run lint
yarn lint

# Lint and fix
yarn run lint:fix
yarn lint:fix
```

### Build for production
Expand All @@ -134,6 +135,16 @@ For example, if I want to add a new `icons` folder, I'd update the `exports` ent
}
```

### Token Update Workflow

1. Pull down the latest code by running `git pull origin main`
2. Checkout a new branch for your changes with `git checkout -b {type}/{jira-ticket}-{description}` - as an example, `feat/khcp-1234-add-color-tokens`
3. Add/edit the tokens in the `/tokens` directory as needed, ensuring to adhere to the [Token Requirements](#token-requirements)
4. Before committing your changes, locally run `yarn lint` to ensure you do not have any linting errors. If you have errors, you can try running `yarn lint:fix` to resolve
5. Commit your changes, adhering to [Conventional Commits](#committing-changes). To make this easier, you're encouraged to run `yarn commit` to help build your commit message
6. Push your branch up to the remote with `git push origin {branch-name}`
7. Open a pull request and request review

### Committing Changes

[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
Expand Down

0 comments on commit 0f303bf

Please sign in to comment.