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

Improve upon intent of outdir: Config file + Clean #26

Open
1 of 4 tasks
connorjs opened this issue Aug 3, 2024 · 1 comment
Open
1 of 4 tasks

Improve upon intent of outdir: Config file + Clean #26

connorjs opened this issue Aug 3, 2024 · 1 comment
Assignees
Labels
docs Improvements or additions to documentation feature New feature, enhancement, or request

Comments

@connorjs
Copy link
Owner

connorjs commented Aug 3, 2024

Background

The original intent of #4 was to improve upon a pain point I felt existed with generating files in the source tree.

  1. Had to add *.css.d.ts to your .gitignore. And repeating it for other extensions.
  2. Cleaning the repository would require additional work
  3. Some folks just prefer less files when looking at their IDE for "real" files

However, upon actually using the alternative structure, I ran into more TypeScript issues than expected. Essentially ./foo.module.css is looked for exactly in that directory. It seems that it was not resolved via other names such as my/path/foo.module.css or similar.

While I have NOT dove deeper into the TS side, this issue led to something that may benefit the tool more.

Config file + subcommands

Introducing a config file (likely via cosmiconfig) will centralize the configuration for the pattern. The tool could then include a clean subcommand that deals with (2) issue.

The config also helps the future potential watch command (although I was originally leaning away from it).

This does not address the .gitignore case, although a init command would solve that.

Goals for this issue

  • Add cosmiconfig lilconfig
  • Add clean command
  • Alias root command to generate and/or get
  • Consider init command
@connorjs
Copy link
Owner Author

connorjs commented Aug 4, 2024

Note: lilconfig over cosmiconfig seems to be a trend for smaller dependencies. By default, it does not support YAML. For a smaller download size, I will gladly give up YAML (and adding it later is backwards-compatible).

Edit later (never hit comment). I added js-yaml to support YAML config, which seems to be common. Was easy enough to maintain (dependency + function + array).

PR #28 covers initial config adding.

@connorjs connorjs added docs Improvements or additions to documentation feature New feature, enhancement, or request labels Aug 4, 2024
@connorjs connorjs self-assigned this Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation feature New feature, enhancement, or request
Projects
None yet
Development

No branches or pull requests

1 participant