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

docs: unwrap nested named union and literal types #1965

Merged
merged 7 commits into from
Mar 29, 2023

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Mar 23, 2023

Created based on the requested #1958 (comment)

This has an impact on these methods:

Processing Module Color
- cmyk
- colorByCSSColorSpace
- hsl
- hwb
- lab
- lch
- rgb
Processing Module Helpers
- unique
Processing Module Internet
- emoji
- httpStatusCode
- url
Processing Module Random
- alpha
- alphaNumeric
- numeric
Processing Module String
- alpha
- alphanumeric
- hexadecimal
- numeric

by unwrapping these types:

AlphaChar -> 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'
AlphaNumericChar -> '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'
Casing -> 'lower' | 'mixed' | 'upper'
ColorFormat -> 'binary' | 'css' | 'decimal'
EmojiType -> 'activity' | 'body' | 'flag' | 'food' | 'nature' | 'object' | 'person' | 'smiley' | 'symbol' | 'travel'
HTTPProtocolType -> 'http' | 'https'
HTTPStatusCodeType -> 'clientError' | 'informational' | 'redirection' | 'serverError' | 'success'
LowerAlphaChar -> 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'
NumberColorFormat -> 'decimal'
NumericChar -> '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
RecordKey -> number | string | symbol
StringColorFormat -> 'binary' | 'css'
UpperAlphaChar -> 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z'

@ST-DDT ST-DDT added c: docs Improvements or additions to documentation p: 1-normal Nothing urgent c: infra Changes to our infrastructure or project setup labels Mar 23, 2023
@ST-DDT ST-DDT requested review from a team March 23, 2023 10:39
@ST-DDT ST-DDT self-assigned this Mar 23, 2023
@ST-DDT
Copy link
Member Author

ST-DDT commented Mar 23, 2023

IMO we should not merge this as is, especially the Char types.

grafik

@ST-DDT ST-DDT added do NOT merge yet Do not merge this PR into the target branch yet s: needs decision Needs team/maintainer decision labels Mar 23, 2023
@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Merging #1965 (fedf74c) into next (8516bfb) will decrease coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1965      +/-   ##
==========================================
- Coverage   99.62%   99.62%   -0.01%     
==========================================
  Files        2450     2450              
  Lines      239748   239748              
  Branches     1272     1271       -1     
==========================================
- Hits       238853   238846       -7     
- Misses        873      880       +7     
  Partials       22       22              

see 2 files with indirect coverage changes

@matthewmayer
Copy link
Contributor

matthewmayer commented Mar 23, 2023

Perhaps there should be a white list allow list of types which are unwrapped or a blacklist bock/deny list of types which are not.

scripts/apidoc/signature.ts Outdated Show resolved Hide resolved
scripts/apidoc/signature.ts Outdated Show resolved Hide resolved
@ST-DDT
Copy link
Member Author

ST-DDT commented Mar 23, 2023

Team Decision

We will block type expansion for all *Char types, but otherwise expand them.

@ST-DDT ST-DDT added s: accepted Accepted feature / Confirmed bug and removed s: needs decision Needs team/maintainer decision labels Mar 23, 2023
@ST-DDT ST-DDT removed the do NOT merge yet Do not merge this PR into the target branch yet label Mar 23, 2023
@ST-DDT
Copy link
Member Author

ST-DDT commented Mar 23, 2023

Docs-Diff:

Documentation changes detected:
- Color
  - cmyk
  - colorByCSSColorSpace
  - hsl
  - hwb
  - lab
  - lch
  - rgb
- Helpers
  - unique
- Internet
  - emoji
  - httpStatusCode
  - url
- Random
  - alpha
  - alphaNumeric
- String
  - alpha
  - alphanumeric
  - hexadecimal

Shinigami92
Shinigami92 previously approved these changes Mar 24, 2023
@ST-DDT ST-DDT merged commit a6e6104 into next Mar 29, 2023
@ST-DDT ST-DDT deleted the docs/unwrap-nested-named-union-types branch March 29, 2023 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: docs Improvements or additions to documentation c: infra Changes to our infrastructure or project setup p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants