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

namespaced kit options #236

Merged
merged 7 commits into from
Dec 7, 2020
Merged

namespaced kit options #236

merged 7 commits into from
Dec 7, 2020

Conversation

Rich-Harris
Copy link
Member

See #229 (comment), though maybe should be kit rather than kitOptions.

Would also like to get some validation in here before this gets merged

@dummdidumm
Copy link
Member

create-svelte needs to be updated, too.

@Rich-Harris
Copy link
Member Author

Renamed kitOptions -> kit, and added some validation: it will warn on any unexpected top-level options, and throw on any invalid kit.* options

export function validate_config(config) {
for (const key in config) {
if (!expected.has(key)) {
warn(`Unexpected option ${key}${key in options ? ` (did you mean kit.${key}?)` : ''}`);
Copy link
Member

Choose a reason for hiding this comment

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

Do you think the 'did you mean' here is going to be generally helpful to future users? Singling this out seems to be maybe a bit too focused on people who used Kit before this change, which is practically nobody.

Copy link
Member Author

Choose a reason for hiding this comment

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

it's really just there to reduce the number of discord DMs/mentions i/we get in the near term. agree that it doesn't serve much long term purpose

Copy link
Member

Choose a reason for hiding this comment

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

I somehow had forgotten that there are people out there using it who don't have access to this repo. In light of that, I'd say that yes this warning was a good idea.

@Rich-Harris Rich-Harris changed the title [WIP] namespaced kit options namespaced kit options Dec 7, 2020
@Rich-Harris Rich-Harris merged commit 0e45255 into master Dec 7, 2020
@Rich-Harris Rich-Harris deleted the options branch December 7, 2020 22:02
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.

None yet

3 participants