Skip to content

refactor: update capabilities:create command to use new inquirer#761

Merged
rossiam merged 1 commit into
SmartThingsCommunity:yargsfrom
rossiam:inquirer-capabilities-create
Jun 10, 2025
Merged

refactor: update capabilities:create command to use new inquirer#761
rossiam merged 1 commit into
SmartThingsCommunity:yargsfrom
rossiam:inquirer-capabilities-create

Conversation

@rossiam
Copy link
Copy Markdown
Collaborator

@rossiam rossiam commented Jun 10, 2025

  • updated capabilities:create command to use new inquirer

@rossiam rossiam requested a review from a team June 10, 2025 16:11
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 10, 2025

⚠️ No Changeset found

Latest commit: 04cb6a2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

validate: unitOfMeasureValidator,
})).unitOfMeasure
const choices: Type[] = ['integer', 'number', 'string', 'boolean']
return await select({ message: `Select an ${message} type:`, choices })
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I recognize that this is unchanged from the previous version, and the things that we're asking for type for both start with vowels, but I wonder if it might be a more robust solution to include the indefinite article in the message that's passed in rather than the wrapper. So message might be "an attribute" and the wrapper would be Select ${message} type:. That way, if we ever want to use this function in the future for something that doesn't start with a vowel, the message presented to the viewer won't be weird.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I almost did that when I was refactoring but decided it wasn't worth it since we need to re-do this whole file to use the input-item module anyway. I probably shouldn't have done half the things I did.

Comment thread src/commands/capabilities/create.ts Outdated
message: 'If you want to add argument, enter a name for it now (enter to finish): ',
})).argumentName
argumentName =
await optionalStringInput('If you want to add argument, enter a name for it now (enter to finish): ')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also a carry-over from the previous version, but: "an argument"?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, fixed.

@rossiam rossiam force-pushed the inquirer-capabilities-create branch from ca762e9 to 04cb6a2 Compare June 10, 2025 20:22
@rossiam rossiam merged commit 8ab17a5 into SmartThingsCommunity:yargs Jun 10, 2025
4 checks passed
@rossiam rossiam deleted the inquirer-capabilities-create branch June 10, 2025 20:33
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