@@ -298,7 +298,7 @@ pub struct Component {
298298 /// Example: `source = "bin/cart.wasm"`
299299 ///
300300 /// Learn more: https://spinframework.dev/writing-apps#the-component-source
301- pub source : ComponentSource ,
301+ pub ( crate ) source : ComponentSource ,
302302 /// A human-readable description of the component.
303303 ///
304304 /// Example: `description = "Shopping cart"`
@@ -397,7 +397,7 @@ pub struct Component {
397397 ///
398398 /// Learn more: https://spinframework.dev/build
399399 #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
400- pub build : Option < ComponentBuildConfig > ,
400+ pub ( crate ) build : Option < ComponentBuildConfig > ,
401401 /// Settings for custom tools or plugins. Spin ignores this field.
402402 #[ serde( default , skip_serializing_if = "Map::is_empty" ) ]
403403 #[ schemars( schema_with = "json_schema::map_of_toml_tables" ) ]
@@ -414,9 +414,11 @@ pub struct Component {
414414 /// Learn more: https://spinframework.dev/writing-apps#using-component-dependencies
415415 #[ serde( default , skip_serializing_if = "ComponentDependencies::is_empty" ) ]
416416 pub dependencies : ComponentDependencies ,
417- /// TODO: profile docs
417+ /// Override values to use when building or running a named build profile.
418+ ///
419+ /// Example: `profile.debug.build.command = "npm run build-debug"`
418420 #[ serde( default , skip_serializing_if = "Map::is_empty" ) ]
419- pub profile : Map < String , ComponentProfileOverride > ,
421+ pub ( crate ) profile : Map < String , ComponentProfileOverride > ,
420422}
421423
422424/// Customisations for a Spin component in a non-default profile.
@@ -429,13 +431,13 @@ pub struct ComponentProfileOverride {
429431 ///
430432 /// Learn more: https://spinframework.dev/writing-apps#the-component-source
431433 #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
432- pub source : Option < ComponentSource > ,
434+ source : Option < ComponentSource > ,
433435
434436 /// The command or commands for building the component in non-default profiles.
435437 /// If a component has no special build instructions for a profile, the
436438 /// default build command is used.
437439 #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
438- pub build : Option < ComponentProfileBuildOverride > ,
440+ build : Option < ComponentProfileBuildOverride > ,
439441}
440442
441443/// Customisations for a Spin component build in a non-default profile.
@@ -448,7 +450,7 @@ pub struct ComponentProfileBuildOverride {
448450 /// Example: `build.command = "cargo build"`
449451 ///
450452 /// Learn more: https://spinframework.dev/build#setting-up-for-spin-build
451- pub command : super :: common:: Commands ,
453+ command : super :: common:: Commands ,
452454}
453455
454456impl Component {
@@ -470,7 +472,7 @@ impl Component {
470472 }
471473
472474 /// The build configuration for the component
473- pub fn build_config ( & self , profile : Option < impl AsRef < str > > ) -> Option < ComponentBuildConfig > {
475+ pub fn build ( & self , profile : Option < & str > ) -> Option < ComponentBuildConfig > {
474476 let build_config = self . build . clone ( ) ;
475477 let build_profile = self . profile ( profile) . and_then ( |o| o. build . as_ref ( ) ) ;
476478
@@ -491,8 +493,8 @@ impl Component {
491493 Some ( build_config)
492494 }
493495
494- /// TODO: docs! docs! docs!
495- pub fn source ( & self , profile : Option < impl AsRef < str > > ) -> & ComponentSource {
496+ /// The source for the component Wasm binary (e.g. local file, registry reference, etc.).
497+ pub fn source ( & self , profile : Option < & str > ) -> & ComponentSource {
496498 let profile_source = self . profile ( profile) . and_then ( |o| o. source . as_ref ( ) ) ;
497499
498500 match profile_source {
0 commit comments