-
Notifications
You must be signed in to change notification settings - Fork 11
CLI Generate feature remote configs #363
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
roncohen
reviewed
Mar 10, 2025
roncohen
approved these changes
Mar 10, 2025
Contributor
roncohen
left a comment
There was a problem hiding this 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
Contributor
Author
|
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
}
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves: BUC-3398, BUC-3387
Copilot Summary
This pull request introduces several enhancements and changes to the
packages/climodule, focusing on improving the configuration options, command-line interface, and type generation processes. The most important changes include updating thetypesOutputconfiguration, modifying command options, and adding new utility functions.Configuration and Command Updates:
packages/cli/README.md: Updated thetypesOutputconfiguration to support an array of objects withpathandformatproperties, and modified related command options (--overwrite,--format) to reflect these changes. [1] [2] [3] [4] [5]Command Implementation Changes:
packages/cli/commands/features.ts: Refactored thegenerateTypesActionto handle multipletypesOutputconfigurations, generating types for each specified format and path. Added new optiontypesFormatOptionfor specifying the format. [1] [2] [3] [4]packages/cli/commands/init.ts: Replaced--forcewith--overwriteoption and added a prompt for selecting the output format during initialization. [1] [2] [3] [4]packages/cli/commands/new.ts: AddedtypesFormatOptionto thenewcommand and updated the configuration handling to support the newtypesOutputformat. [1] [2]Utility and Schema Changes:
packages/cli/stores/config.ts: AddedtypeFormatsandTypesOutputtypes, and a helper functionnormalizeTypesOutputto standardize thetypesOutputconfiguration. [1] [2] [3] [4]packages/cli/schema.json: Updated the schema to reflect the newtypesOutputstructure, allowing an array of objects withpathandformatproperties.Miscellaneous:
packages/cli/package.json: Bumped the version to0.1.3, added new scripts for testing and coverage, and included additional dependencies. [1] [2] [3]packages/cli/index.ts: Added a utility functionstripTrailingSlashto clean up URLs before setting the configuration. [1] [2]packages/cli/services/features.ts: Enhanced thelistFeaturesfunction to include remote configurations and added new types for handling remote config variants.