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

(fix) allow boolean or number values in slsw.lib.options #857

Merged
merged 1 commit into from
Jun 8, 2021
Merged

(fix) allow boolean or number values in slsw.lib.options #857

merged 1 commit into from
Jun 8, 2021

Conversation

coyoteecd
Copy link
Contributor

What did you implement:

This change relaxes the types for sls.lib.options object.
Makes it possible to use e.g. boolean options passed via serverless CLI in a typed webpack.config.ts without getting TS compile errors.

For example
const watchEnabled = slsw.lib.options.watch === true; // now gives compile error saying watch must be a string

How did you implement it:

How can we verify it:

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@j0k3r
Copy link
Member

j0k3r commented Jun 8, 2021

Could you rebase against the master? So I'll be able to merge and ship it for 5.5.1. Thanks 🙏

This makes it possible to use e.g. boolean options passed via serverless CLI in a typed webpack.config.ts without getting TS compile errors.
For example, const watchEnabled = slsw.lib.options.watch === true
@coyoteecd
Copy link
Contributor Author

@j0k3r done

@j0k3r j0k3r added this to the 5.5.1 milestone Jun 8, 2021
@j0k3r j0k3r merged commit 3953db2 into serverless-heaven:master Jun 8, 2021
@coyoteecd coyoteecd deleted the relax-options-typings branch September 21, 2021 10:21
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.

2 participants