11mod bun;
22mod node;
3- mod prompts;
3+ pub mod prompts;
44mod rust;
5- mod toolchain;
65
76use crate :: session:: MoonSession ;
87use bun:: init_bun;
@@ -11,25 +10,22 @@ use clean_path::Clean;
1110use iocraft:: prelude:: { FlexDirection , View , element} ;
1211use miette:: IntoDiagnostic ;
1312use moon_common:: { Id , consts:: CONFIG_DIRNAME , is_test_env} ;
14- use moon_config:: {
15- ToolchainConfig , load_toolchain_config_template, load_workspace_config_template,
16- } ;
13+ use moon_config:: { load_toolchain_config_template, load_workspace_config_template} ;
1714use moon_console:: {
1815 Console ,
1916 ui:: { Confirm , Container , Notice , StyledText , Variant } ,
2017} ;
2118use moon_vcs:: { Git , Vcs } ;
2219use node:: init_node;
23- use proto_core:: { Id as PluginId , PluginLocator } ;
20+ use proto_core:: PluginLocator ;
2421use rust:: init_rust;
2522use starbase:: AppResult ;
2623use starbase_styles:: color;
2724use starbase_utils:: fs;
2825use std:: collections:: BTreeMap ;
2926use std:: path:: PathBuf ;
3027use tera:: { Context , Tera } ;
31- use toolchain:: init_toolchain;
32- use tracing:: instrument;
28+ use tracing:: { instrument, warn} ;
3329
3430#[ derive( Args , Clone , Debug ) ]
3531pub struct InitArgs {
@@ -164,41 +160,12 @@ pub async fn init_for_toolchain(
164160 "node" => init_node ( console, options) . await ?,
165161 "rust" => init_rust ( console, options) . await ?,
166162 _ => {
167- let mut include_locator = true ;
168- let plugin_id = PluginId :: raw ( id. as_str ( ) ) ;
169- let plugin_locator = match args. plugin . as_ref ( ) {
170- Some ( locator) => locator. to_owned ( ) ,
171- None => match ToolchainConfig :: get_plugin_locator ( id) {
172- Some ( locator) => {
173- include_locator = false ;
174- locator
175- }
176- None => {
177- console. err . write_line (
178- "A plugin locator is required as the 2nd argument when initializing a toolchain!"
179- ) ?;
180-
181- return Ok ( Some ( 1 ) ) ;
182- }
183- } ,
184- } ;
185-
186- let toolchain_registry = session. get_toolchain_registry ( ) . await ?;
187-
188- toolchain_registry
189- . load_without_config ( & plugin_id, plugin_locator)
190- . await ?;
191-
192- let toolchain = toolchain_registry. get_instance ( & plugin_id) . await ?;
163+ warn ! (
164+ "This command has been deprecated for toolchain plugins, use {} instead." ,
165+ color:: shell( format!( "moon toolchain add {}" , id) )
166+ ) ;
193167
194- init_toolchain (
195- & session. console ,
196- options,
197- & toolchain_registry,
198- & toolchain,
199- include_locator,
200- )
201- . await ?
168+ return Ok ( None ) ;
202169 }
203170 } ;
204171
0 commit comments