Skip to content

Conversation

@Swiftwork
Copy link
Contributor

@Swiftwork Swiftwork commented Mar 6, 2025

Resolves: BUC-3398, BUC-3387

Copilot Summary

This pull request introduces several enhancements and changes to the packages/cli module, focusing on improving the configuration options, command-line interface, and type generation processes. The most important changes include updating the typesOutput configuration, modifying command options, and adding new utility functions.

Configuration and Command Updates:

  • packages/cli/README.md: Updated the typesOutput configuration to support an array of objects with path and format properties, and modified related command options (--overwrite, --format) to reflect these changes. [1] [2] [3] [4] [5]

Command Implementation Changes:

Utility and Schema Changes:

  • packages/cli/stores/config.ts: Added typeFormats and TypesOutput types, and a helper function normalizeTypesOutput to standardize the typesOutput configuration. [1] [2] [3] [4]
  • packages/cli/schema.json: Updated the schema to reflect the new typesOutput structure, allowing an array of objects with path and format properties.

Miscellaneous:

@Swiftwork Swiftwork self-assigned this Mar 6, 2025
@Swiftwork Swiftwork added the enhancement New feature or request label Mar 7, 2025
@Swiftwork Swiftwork marked this pull request as ready for review March 7, 2025 15:35
@Swiftwork Swiftwork requested a review from roncohen March 7, 2025 15:35
Copy link
Contributor

@roncohen roncohen left a comment

Choose a reason for hiding this comment

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

looks very reasonable! only had one comment

@Swiftwork
Copy link
Contributor Author

Swiftwork commented Mar 10, 2025

I decided to rewrite the gen a little to create individual config types instead of inlining. This makes the features list more readable and you can import the types individually which is good for reuse (we use this pattern in the web).

// DO NOT EDIT THIS FILE. IT IS GENERATED BY THE BUCKET CLI AND WILL BE OVERWRITTEN.
// eslint-disable
// prettier-ignore
import "@bucketco/node-sdk";

declare module "@bucketco/node-sdk" {
  export interface Features {
    "stages": boolean;
    "simplified-targeting": boolean;
    "revamped-debugger": boolean;
    "dynamic-configs": boolean;
    "debugger-config-events": boolean;
    "cli-types-test": { config: { payload: CliTypesTestConfigPayload } };
    "bytescale-image-processing": boolean;
    "add-in-bulk": boolean;
  }

  export type CliTypesTestConfigPayload = {
    model: boolean | string,
    tokens: string | number,
    sideEffects?: boolean,
    array?: (number | number | boolean | {
      different?: boolean,
      object?: boolean
    })[],
    nested?: {
      key: string,
      value: null
    }
  }
}

@Swiftwork Swiftwork merged commit cbca268 into main Mar 10, 2025
5 checks passed
@Swiftwork Swiftwork deleted the feat/cli-improvements-configs branch March 10, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants