File tree Expand file tree Collapse file tree 5 files changed +32
-5
lines changed
components/reference/enrichments/cli
packages/common/enabled-features Expand file tree Collapse file tree 5 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,35 @@ import RefSubLayout from '~/layouts/ref/RefSubLayout'
22
33import spec from '~/spec/cli_v1_commands.yaml' with { type : 'yaml' }
44import Param from '~/components/Params'
5+ import { isFeatureEnabled } from 'common'
6+ import { getCustomContent } from '~/lib/custom-content/getCustomContent'
7+
8+ const { cliDisableCustomProfiles } = isFeatureEnabled ( [ 'cli:disable_custom_profiles' ] )
59
610const CliGlobalFlagsHandler = ( ) => {
11+ // Only fetch cliProfile when custom profiles are enabled
12+ const cliProfile = ! cliDisableCustomProfiles
13+ ? getCustomContent ( [ 'cli:profile' ] as any ) . cliProfile
14+ : undefined
15+
16+ // Transform the flags based on feature flags
17+ const processedFlags = spec . flags . map ( ( flag : any ) => {
18+ if ( flag . id === 'profile' && ! cliDisableCustomProfiles ) {
19+ return {
20+ id : 'profile' ,
21+ name : `--profile ${ cliProfile } ` ,
22+ description : `use ${ cliProfile } profile for connecting to Supabase API` ,
23+ }
24+ }
25+ return flag
26+ } )
27+
728 return (
829 < RefSubLayout . EducationRow className = "not-prose" >
930 < RefSubLayout . Details >
1031 < h3 className = "text-lg text-foreground mb-3" > Flags</ h3 >
1132 < ul >
12- { spec . flags . map ( ( flag ) => {
33+ { processedFlags . map ( ( flag ) => {
1334 return (
1435 < Param
1536 { ...flag }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ export type CustomContentTypes = {
22 homepageHeading : string
33 metadataApplicationName : string
44 metadataTitle : string
5+ cliProfile : string
56 navigationLogo : {
67 light : string
78 dark : string
Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ function contentToCamelCase(feature: CustomContent) {
2121}
2222
2323type CustomContentResult < T extends CustomContent [ ] > = {
24- [ key in CustomContentToCamelCase < T [ number ] > ] :
25- | CustomContentTypes [ CustomContentToCamelCase < T [ number ] > ]
26- | null
24+ [ key in CustomContentToCamelCase < T [ number ] > extends keyof CustomContentTypes
25+ ? CustomContentToCamelCase < T [ number ] >
26+ : never ] : CustomContentTypes [ key ] | null
2727}
2828
2929export const getCustomContent = < T extends CustomContent [ ] > (
Original file line number Diff line number Diff line change 2929
3030 "branding:large_logo" : false ,
3131
32+ "cli:disable_custom_profiles" : true ,
33+
3234 "dashboard_auth:sign_up" : true ,
3335 "dashboard_auth:sign_in_with_github" : true ,
3436 "dashboard_auth:sign_in_with_sso" : true ,
Original file line number Diff line number Diff line change 9999 "type" : " boolean" ,
100100 "description" : " Show larger logo sizes throughout the apps"
101101 },
102-
102+ "cli:disable_custom_profiles" : {
103+ "type" : " boolean" ,
104+ "description" : " Disable custom CLI profiles feature"
105+ },
103106 "dashboard_auth:sign_up" : {
104107 "type" : " boolean" ,
105108 "description" : " Enable the sign up page in the dashboard"
You can’t perform that action at this time.
0 commit comments