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

refactor: simplify and document config.ts #238

Merged
merged 1 commit into from
Jan 14, 2022
Merged

Conversation

threepointone
Copy link
Contributor

@threepointone threepointone commented Jan 13, 2022

This PR cleans up the type definition for the configuration object, as well as commenting the hell out of it. There are no duplicate definitions, and I annotated what I could.

  • @optional means providing a value isn't mandatory
  • @deprecated means the field itself isn't necessary anymore in wrangler.toml
  • @breaking means the deprecation/optionality is a breaking change from wrangler 1
  • @todo means there's more work to be done (with details attached)
  • @inherited means the field is copied to all environments

I also added a stub for the validation function that will be applied to config objects. In the next PR, I will flesh that function out.

You should review this with split view, since the unified view doesn't really make sense here.

@changeset-bot
Copy link

changeset-bot bot commented Jan 13, 2022

🦋 Changeset detected

Latest commit: c1b5be5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@JacobMGEvans
Copy link
Contributor

should the decorators be annotated at the top of the file?

@optional means the field isn't necessary in wrangler.toml
@deprecated means the field isn't necessary anymore in wrangler.toml
@breaking means the deprecation/optionality is a breaking change
@todo means there's more work to be done (with details attached)
@inherited means the field is copied to all environments

export type Config = { ...

@threepointone threepointone force-pushed the typed-config branch 3 times, most recently from b06ed5b to e5fa75a Compare January 14, 2022 16:12
Copy link
Contributor

@JacobMGEvans JacobMGEvans left a comment

Choose a reason for hiding this comment

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

Looks good!

This PR cleans up the type definition for the configuration object, as well as commenting the hell out of it. There are no duplicate definitions, and I annotated what I could.

- `@optional` means providing a value isn't mandatory
- `@deprecated` means the field itself isn't necessary _anymore_ in `wrangler.toml`
- `@breaking` means the deprecation/optionality is a breaking change from wrangler 1
- `@todo` means there's more work to be done (with details attached)
- `@inherited` means the field is copied to all environments

I also added a stub for the validation function that will be applied to config objects. In the next PR, I will flesh that function out.
@github-actions github-actions bot mentioned this pull request Jan 14, 2022
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.

3 participants