Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI updates #48

Merged
merged 3 commits into from
May 26, 2024
Merged

CLI updates #48

merged 3 commits into from
May 26, 2024

Conversation

tbeseda
Copy link
Contributor

@tbeseda tbeseda commented May 24, 2024

Expand cli.mjs to enable standalone usage as a dependency.

Excerpt from updated README:

To use Enhance Styles in other applications or frameworks, install Enhance Styles from npm:

```shell
npm i -D @enhance/styles
```

The built in CLI, `enhance-styles`, takes two arguments: `--config=` and `--output=`. The `--config` argument is the path to your configuration file and the `--output` argument is the path where the .css file will be created. 

If you do not specify config, the default configuration will be used.  
You can use the default configuration or [create your own](#customize). We recommend a local project file like `./styleguide.json`.

If you do not specify output, the CSS will be printed to stdout.

```shell
npx enhance-styles --config=./styleguide.json --output=./public/enhance.css
```

OR a single arg for config file to be backwards compat
Copy link

@RMcNeely RMcNeely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My big question here is what happens if I only want to change a few values in the config? Realistically I'm probably going to want to change something like typeScale and some theme colors but reading the cli.mjs file it looks like I need to copy the entire config.json from the root and make changes or I imagine it will break somewhere (even if it compiles fine).

Documentation wise I think what you have is good but that is something that I would address since its probably how this would be used as an external dependency.

@colepeters
Copy link
Member

colepeters commented May 24, 2024

My big question here is what happens if I only want to change a few values in the config?

Great question! We need to test things out a bit more, but some of the fields used in the config have been set up with default values (see scales, for example), so that partial configs can be supplied and the defaults will fill in the rest. That said, we've only just started doing this, so there are likely some gaps still. Will definitely be looking at resolving this in near future releases!

@tbeseda tbeseda merged commit 99fca34 into main May 26, 2024
3 checks passed
@tbeseda tbeseda deleted the cli-updates branch May 26, 2024 17:21
@github-actions github-actions bot locked and limited conversation to collaborators May 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants