Conversation
|
👋 @marcospassos
☝️ Lastly, the title for the commit will come from the pull request title. So please provide a descriptive title that summarizes the changes in 50 characters or less using the imperative mood. |
commit: |
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the CLI init command and related form handlers to track newly created entities, refines slug generation, and adjusts publish logic in the GraphQL workspace API.
- Update GraphQL API
publishflag logic and slug baseName for environments - Extend form handlers to return a
newflag viaSelected*types - Introduce
resolveApplicationininitcommand for smarter production application selection
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/infrastructure/application/api/graphql/workspace.ts | Simplify publish flag check; refine slug baseName conditional |
| src/application/cli/form/workspace/workspaceForm.ts | Return SelectedWorkspace with new flag |
| src/application/cli/form/organization/organizationForm.ts | Return SelectedOrganization with new flag |
| src/application/cli/form/application/applicationForm.ts | Return SelectedApplication with new flag and updated labels |
| src/application/cli/command/init.ts | Adjust init logic to use new flags and add resolveApplication |
Comments suppressed due to low confidence (4)
src/application/cli/form/workspace/workspaceForm.ts:22
- [nitpick] Using a property named
newcan be confusing given it’s a reserved keyword; consider renaming it toisNeworcreatedNewfor clarity.
export type SelectedWorkspace = Workspace & {
src/application/cli/form/organization/organizationForm.ts:20
- [nitpick] The optional
newproperty may be mistaken for the keyword; renaming toisNewOrganizationorcreatedNewwould improve readability.
export type SelectedOrganization = Organization & {
src/application/cli/form/application/applicationForm.ts:27
- [nitpick] Consider renaming the
newfield toisNeworisNewApplicationto avoid confusion with the JavaScriptnewkeyword.
export type SelectedApplication = Application & {
src/application/cli/command/init.ts:227
- The new
resolveApplicationmethod introduces branching logic for production vs. development flows; consider adding targeted unit tests to cover scenarios where it returnsnullor invokesgetApplication.
private async resolveApplication(options: ApplicationOptions, applicationSlug?: string): Promise<Application|null> {
| content: GraphqlWorkspaceApi.createContentVariantGroup(experience.content), | ||
| validate: true, | ||
| publish: experience.draft === false, | ||
| publish: experience.draft !== true, |
There was a problem hiding this comment.
The expression experience.draft !== true is equivalent to !experience.draft but may be less idiomatic; consider using publish: !experience.draft for clarity.
| publish: experience.draft !== true, | |
| publish: !experience.draft, |
Summary
This PR fixes issues with the
initcommand when using thenewoption and resolves a bug that was preventing the CLI from detecting production applications.Checklist