-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add brandedAliases option for strongly branded aliases #225
base: develop
Are you sure you want to change the base?
Conversation
Generate changelog in
|
@@ -106,6 +106,7 @@ export { integrationSecond }; | |||
|
|||
const irDir = path.join(__dirname, "../../../../build/ir-test-cases"); | |||
const testCaseDir = path.join(__dirname, "resources/test-cases"); | |||
const brandedTestCaseDir = path.join(__dirname, "resources/branded-test-cases"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was torn on duplicating the test-cases again and having a whole other copy of these generated files for this generatorTest
, but I think it's good to be clear and actually differentiate the flavored from branded.
It does make for some noise now in this PR though, at least you can skip over anything src/commands/generate/__tests__/resources/branded-test-cases/**
(they're also the only added files)
`\t${FLAVOR_TYPE_FIELD}?: "${definition.typeName.name}",`, | ||
`\t${FLAVOR_PACKAGE_FIELD}?: "${definition.typeName.package}",`, | ||
`\t${FLAVOR_TYPE_FIELD}${maybeOptional}: "${definition.typeName.name}",`, | ||
`\t${FLAVOR_PACKAGE_FIELD}${maybeOptional}: "${definition.typeName.package}",`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only actual generator change
Before this PR
Flavored aliases are great but don't quite afford enough type safety in projects that require stricter typing to avoid accidental misuse, at the cost of requiring more intentional type assertions.
Hopefully the readme additions describe/justify the difference and tradeoff between flavorizing & branded.
After this PR
==COMMIT_MSG==
==COMMIT_MSG==
Possible downsides?