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

Attempt to auto-detect configuration files with varying file extensions #139

Merged
merged 4 commits into from
Mar 30, 2024

Conversation

JamesMGreene
Copy link
Contributor

@JamesMGreene JamesMGreene commented Mar 29, 2024

Context

Purpose

If no generator file path is manually provided as input, this change loops through our supported file extensions seeking the existence of a configuration file that matches the static site generator's chosen configuration file basename, e.g. for Next.js:

  • Does next.config.js exist?
  • If not, does next.config.cjs exist?
  • If not, does next.config.mjs exist?
  • If not, fallback to next.config.js and create the file

Risks

I did not add any new tests for this slight behavioral change as it basically boils down to a loop that checks for file existence. Feel free to push back if you feel more testing is needed. 😅

@JamesMGreene JamesMGreene requested a review from a team as a code owner March 29, 2024 02:17
@JamesMGreene JamesMGreene merged commit 983d773 into main Mar 30, 2024
6 checks passed
@JamesMGreene JamesMGreene deleted the config-auto-detect branch March 30, 2024 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants