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

Handle numbers in action/type names #99

Merged
merged 11 commits into from May 25, 2020
Merged

Handle numbers in action/type names #99

merged 11 commits into from May 25, 2020

Conversation

ahwatts
Copy link
Contributor

@ahwatts ahwatts commented Jan 28, 2020

A recent update to reduxsauce's making of type names broke our code because it changed the way it was handling numbers in the type name.

We have an action, storeS3Key, which we were expecting to be translated to STORE_S3_KEY. However, with the change to the regex that converts to SCREAMING_SNAKE_CASE, it was being translated to STORES3_KEY. This PR changes that to treat numbers as being part of the preceding word.

jkeam and others added 10 commits October 23, 2019 00:10
Release - Dep Update & Tests & Cleanup
fix(release): Release new version with updated deps
fix(release): Trigger build
## [1.1.1](jkeam/reduxsauce@v1.1.0...v1.1.1) (2019-10-23)

### Bug Fixes

* **release:** Trigger build ([151c806](jkeam@151c806))
* **release:** Trigger build ([a1c80b0](jkeam@a1c80b0))
Merge pull request jkeam#97 from jkeam/develop
## [1.1.2](jkeam/reduxsauce@v1.1.1...v1.1.2) (2020-01-19)

### Bug Fixes

* **typescript:** allow objects while creating actions ([jkeam#94](jkeam#94)) ([9a66227](jkeam@9a66227))
Handle numbers in action names as if they were lowercase letters or subsequent capital letters, e.g:

storeS3Key -> STORE_S3_KEY
usePython3Instead -> USE_PYTHON3_INSTEAD
so I can use this from the git repo.
@jkeam
Copy link
Owner

jkeam commented Mar 6, 2020

Great enhancement! Question about the package-lock file, any reason for checking it in? Also question about the package.json, any reason for adding the 'prepare' script?

@ahwatts
Copy link
Contributor Author

ahwatts commented Mar 18, 2020

Sorry, I saw this and forgot about it for a few days. The package.json change with the prepare script was added so that I could install the package directly from the git repo. The package-lock.json file was probably checked in by accident. Neither of those changes is substantive, and I (or you) can drop them if you'd like.

@jkeam jkeam self-assigned this Apr 4, 2020
@jkeam
Copy link
Owner

jkeam commented Apr 4, 2020

Hi I was looking to drop the package.json and package-lock.json as well as a small edit to change the * to a + in your PR (like the regex was before). I don't mind doing it, but can you double check to make sure that edits by the maintainers are allowed? Or you can do it if you prefer. Just let me know!

To be specific, I was thinking the regex would be:

const RX_CAPS = /(?!^)([A-Z][a-z0-9]+|[A-Z][A-Z0-9]+(?=[A-Z]|\b))/g

instead of

const RX_CAPS = /(?!^)([A-Z][a-z0-9]+|[A-Z][A-Z0-9]*(?=[A-Z]|\b))/g

@ahwatts
Copy link
Contributor Author

ahwatts commented May 21, 2020

I don't necessarily have a problem with that change, but it does have the potential issue that it won't recognize single-letter "words" at the end of the name.

For example, an action called actionA would turn in to ACTIONA instead of ACTION_A.

It also would break the consecutive-capitals-as-one-word rule:

actionAStar would be ACTIONA_STAR instead of ACTION_ASTAR.

@jkeam jkeam changed the base branch from master to develop May 25, 2020 18:33
@jkeam
Copy link
Owner

jkeam commented May 25, 2020

Ya good point. Thanks again for all your help and contribution. I'm going to merge this into develop and then most likely fix the package json in another PR.

@jkeam jkeam merged commit 99ee68b into jkeam:develop May 25, 2020
@ahwatts
Copy link
Contributor Author

ahwatts commented Jul 27, 2020

Can we get this in to a release soon?

@jkeam
Copy link
Owner

jkeam commented Jul 27, 2020

Ya! Thanks for following back up. I wanna say by the end of this week. I'll drop a note here once it's been released.

@ahwatts
Copy link
Contributor Author

ahwatts commented Jul 27, 2020 via email

@jkeam
Copy link
Owner

jkeam commented Jul 30, 2020

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jkeam jkeam added the released label Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants