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

Optionally get custom scripts config from toolkit.config.js #188

Closed
wants to merge 1 commit into from

Conversation

kmcaloon
Copy link

Description of the Change

Gives developers the option to use a toolkit.config.js file at the root of their project for custom 10up-toolkit configuration. If present this will override any toolkit config within package.json.

Closes #187

Alternate Designs

I had thought about modifying the getPackage function, but the package build config depends on this function to retrieve other properties from package.json. Only getTenUpScriptsConfig is concerned with custom config.

Possible Drawbacks

Might be a little confusing for devs now having 3 different options for custom config. I think this would at least eliminate the need to provide the option for a custom filenames.config.js.

Verification Process

Followed the contributing guidelines and tested with the 10up-theme. Removed 10up-toolkit from package.json, placed the configuration along with new entries within a toolkit.config.js at the root of the project, and all assets were processed as they should have been when running npm start.

Note: Tests are failing due to hasProjectFileMock.mockReturnValue(true) within multiple tests. Honestly I'm not sure what the preferred fix would be here.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Credits

Props @

@nicholasio
Copy link
Member

Thanks for your PR! I'll be reviewing this soon!

@nicholasio nicholasio self-requested a review April 29, 2022 20:28
@nicholasio nicholasio added this to the 10up-toolkit@4.1.0 milestone May 16, 2022
@nicholasio nicholasio closed this Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to customize config in a toolkit.config.js file instead of package.json
2 participants