mirror of https://github.com/open-feature/cli.git
25 lines
607 B
Go
25 lines
607 B
Go
package react
|
|
|
|
import (
|
|
"github.com/open-feature/cli/internal/generate"
|
|
"github.com/open-feature/cli/internal/generate/plugins/react"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// Cmd for "generate" command, handling code generation for flag accessors
|
|
var Cmd = &cobra.Command{
|
|
Use: "react",
|
|
Short: "Generate typesafe React Hooks.",
|
|
Long: `Generate typesafe React Hooks compatible with the OpenFeature React SDK.`,
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
params := react.Params{}
|
|
gen := react.NewGenerator(params)
|
|
err := generate.CreateFlagAccessors(gen)
|
|
return err
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
}
|