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

port validation and configOptions to TS #1309

Merged
merged 6 commits into from
Dec 20, 2024
Merged

Conversation

brandenrodgers
Copy link
Contributor

Description and Context

This is dependent on HubSpot/hubspot-local-dev-lib#223

This ports lib/validation.ts and lib/configOptions.ts to Typescript. I found some bugs while doing this that I'll call out inline.

Screenshots

TODO

Who to Notify

{
type: 'list',
look: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

look does not exist as a supported field (search in repo)

@@ -91,25 +102,24 @@ const setDefaultCmsPublishMode = async ({
newDefault = defaultCmsPublishMode;
} else {
logger.error(
i18n(`${i18nKey}.defaultMode.errors`, {
mode: newDefault,
i18n(`${i18nKey}.defaultMode.error`, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were using the wrong lang key, and newDefault is undefined here

@@ -134,13 +150,7 @@ const setHttpTimeout = async ({ accountId, httpTimeout }) => {

updateHttpTimeout(newHttpTimeout);

return logger.success(
logger.success(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's no need for any of these to return

lib/validation.ts Outdated Show resolved Hide resolved
validModes: commaSeparatedValues(ALL_CMS_PUBLISH_MODES),
})
);
newDefault = await selectCMsPublishMode();
newDefault = await selectCmsPublishMode();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We had a casing issue here that TS picked up 🎉

@brandenrodgers brandenrodgers marked this pull request as ready for review December 18, 2024 20:00
Copy link
Contributor

@camden11 camden11 left a comment

Choose a reason for hiding this comment

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

One minor comment but overall LGTM

lib/validation.ts Outdated Show resolved Hide resolved
@brandenrodgers brandenrodgers merged commit fafbd92 into next Dec 20, 2024
1 check passed
@brandenrodgers brandenrodgers deleted the br/lib-ts-port-2 branch December 20, 2024 22:01
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