11import {
22 CreatePlan ,
3+ ExampleConfig ,
34 FileUtils ,
45 Resource ,
56 ResourceSettings ,
@@ -26,13 +27,43 @@ export interface HomebrewConfig extends ResourceConfig {
2627 onlyPlanUserInstalled : boolean
2728}
2829
30+ const defaultConfig : Partial < HomebrewConfig > = {
31+ formulae : [ ] ,
32+ casks : [ ] ,
33+ }
34+
35+ const exampleFormulae : ExampleConfig = {
36+ title : 'Install common CLI tools' ,
37+ description : 'Install Homebrew and a set of essential command-line utilities for development.' ,
38+ configs : [ {
39+ type : 'homebrew' ,
40+ formulae : [ 'git' , 'wget' , 'jq' , 'ripgrep' , 'tree' , 'htop' ] ,
41+ casks : [ ] ,
42+ } ]
43+ }
44+
45+ const exampleWithCasks : ExampleConfig = {
46+ title : 'Install CLI tools and GUI apps' ,
47+ description : 'Install Homebrew with developer CLI tools and popular GUI applications via casks.' ,
48+ configs : [ {
49+ type : 'homebrew' ,
50+ formulae : [ 'git' , 'wget' , 'jq' , 'ripgrep' ] ,
51+ casks : [ 'visual-studio-code' , 'iterm2' , 'google-chrome' ] ,
52+ } ]
53+ }
54+
2955export class HomebrewResource extends Resource < HomebrewConfig > {
3056
3157 override getSettings ( ) : ResourceSettings < HomebrewConfig > {
3258 return {
3359 schema : HomebrewSchema ,
3460 operatingSystems : [ OS . Darwin , OS . Linux ] ,
3561 id : 'homebrew' ,
62+ defaultConfig,
63+ exampleConfigs : {
64+ example1 : exampleFormulae ,
65+ example2 : exampleWithCasks ,
66+ } ,
3667 parameterSettings : {
3768 taps : { type : 'stateful' , definition : new TapsParameter ( ) , order : 1 } ,
3869 formulae : { type : 'stateful' , definition : new FormulaeParameter ( ) , order : 2 } ,
0 commit comments