Skip to content

feat(codegen): emit skipPrompt: true for fields with backend-managed defaults#784

Merged
pyramation merged 3 commits intomainfrom
devin/1772748238-codegen-skip-prompt
Mar 5, 2026
Merged

feat(codegen): emit skipPrompt: true for fields with backend-managed defaults#784
pyramation merged 3 commits intomainfrom
devin/1772748238-codegen-skip-prompt

Conversation

@pyramation
Copy link
Contributor

@pyramation pyramation commented Mar 5, 2026

feat(codegen): emit skipPrompt: true for fields with backend-managed defaults

Summary

Updates the CLI codegen template (table-command-generator.ts) so that question objects for fields with backend-managed defaults include skipPrompt: true. This tells inquirerer to skip interactive prompting for these fields while still allowing CLI flag overrides (e.g. --fieldName value) and man page documentation.

Template change (the only hand-written code): In buildMutationHandler, fields in fieldsWithDefaults now get an additional skipPrompt: true property appended to their question definition. The remaining ~1,480 lines of diff are regenerated CLI command files reflecting this change across 134 files / 4 APIs.

Dependency: This relies on skipPrompt support in inquirerer (merged and published as inquirerer@4.6.0).

Updates since last revision

  • Removed // @ts-nocheck workaroundinquirerer@4.6.0 is now published with the skipPrompt type, so the generated CLI code compiles cleanly without any type suppressions. The post-processing step in generate-sdk.ts that injected // @ts-nocheck has been removed entirely.
  • Bumped inquirerer to ^4.6.0 in sdk/constructive-cli/package.json.
  • Regenerated all CLI files — clean TypeScript output with zero @ts-nocheck, @ts-ignore, or as any casts.

Review & Testing Checklist for Human

  • Verify fieldsWithDefaults accuracy — Spot-check a few generated files (e.g. invite.ts, view.ts, app-membership.ts) to confirm the right fields got skipPrompt: true and required fields (those without defaults) did NOT. The correctness of which fields are skipped depends entirely on getFieldsWithDefaults().
  • Update handler behavior — Both handleCreate and handleUpdate emit skipPrompt: true for defaulted fields. For updates, all fields are already required: false, so skipPrompt means they won't appear in the interactive prompt at all. Confirm this is the desired UX for updates.
  • No codegen test coverage for this path — The example schema used in codegen tests has no fields with defaults, so no snapshots changed. Consider whether a test case with a defaulted field should be added.
  • End-to-end test: Run csdk interactively against a table with defaulted fields (e.g. invite create) to verify that defaulted fields are skipped in the prompt but can still be set via --fieldName value.

Notes

  • Link to Devin Session
  • Requested by @pyramation
  • The pnpm-lock.yaml diff is large due to lockfile formatting changes — the only meaningful dependency change is inquirerer ^4.5.2^4.6.0.

…defaults

When generating CLI commands, fields detected as having backend defaults
(via getFieldsWithDefaults) now include skipPrompt: true in their question
definition. This tells inquirerer to skip prompting for these fields while
still allowing CLI flag overrides and man page documentation.

Updated codegen template + regenerated all constructive-cli commands.
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

…pt is published

The generated CLI code now uses skipPrompt which is not yet in the
published inquirerer types (pending dev-utils PR #68). The generate
script adds @ts-nocheck to CLI .ts files as a temporary measure.
This can be removed once inquirerer is published with skipPrompt support.
inquirerer v4.6.0 now includes skipPrompt support, so the generated CLI
code compiles cleanly without @ts-nocheck. Removed the post-generation
ts-nocheck step from generate-sdk.ts and regenerated all CLI files.
@pyramation pyramation merged commit 72a38f0 into main Mar 5, 2026
43 checks passed
@pyramation pyramation deleted the devin/1772748238-codegen-skip-prompt branch March 5, 2026 22:41
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.

1 participant