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 Remaining string modules #178

Merged
merged 8 commits into from
Nov 13, 2022

Conversation

skeate
Copy link
Collaborator

@skeate skeate commented Nov 12, 2022

  • Adds trailing commas rule in Prettier. I kept yanking lines around and then having things break because they lacked trailing commas.
  • HslColor (closes HslColor #174)
  • RGB (closes RGB #175)
  • UUID (closes UUID #176)
  • LatLong (closes LatLong #177)
  • Updated branding with a relevant usage in the UUID module (the version is now part of the brand) (closes Fix branding #170)
  • Removed schemable generation code that relied on src/string since that folder no longer exists and we have no plans to ever remake it (new modules should be WithX extensions)
  • A functional integerRange for pattern builder! woo
    • regexFromPattern(PB.integerRange(12, 31)) => (something like) /^(1[2-9]|2\d|3[0-1])$/

apologies for the length, but the commits should be mostly self-contained.

@skeate skeate added this to the 1.0 milestone Nov 12, 2022
jacob-alford
jacob-alford previously approved these changes Nov 12, 2022
Copy link
Owner

@jacob-alford jacob-alford left a comment

Choose a reason for hiding this comment

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

Looks great! Just needs a quick jsdoc fix and it should be good to merge.

Also, this might close #92, but not completely sure.

*/
export type UUIDS<Version extends UUIDVersion> = SchemaExt<string, UUID<Version>>

export const UUID = <Version extends UUIDVersion>(version: Version): UUIDS<Version> =>
Copy link
Owner

Choose a reason for hiding this comment

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

You might need a jsdoc here for docs-ts, though jsdoc will be merged in vscode with all exports with identical names (not sure how it works)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oops

}
})

test('arbitrary ranges', () => {
Copy link
Owner

Choose a reason for hiding this comment

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

Great tests!

@skeate
Copy link
Collaborator Author

skeate commented Nov 13, 2022

it does not close #92

Copy link
Owner

@jacob-alford jacob-alford left a comment

Choose a reason for hiding this comment

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

LGTM!

@skeate skeate merged commit 1680a8f into 1.0.0-schema-first Nov 13, 2022
@jacob-alford jacob-alford deleted the remaining-string-modules branch November 27, 2022 23:30
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