From c581b09ea9138887e249bd29ee207e9f1036cb19 Mon Sep 17 00:00:00 2001 From: heulitig Date: Fri, 5 Apr 2024 11:05:21 +0530 Subject: [PATCH 1/2] migration changes --- fastn-core/src/lib.rs | 2 +- ftd/src/interpreter/utils.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fastn-core/src/lib.rs b/fastn-core/src/lib.rs index d370d653d4..cdc49d7fc7 100644 --- a/fastn-core/src/lib.rs +++ b/fastn-core/src/lib.rs @@ -48,7 +48,7 @@ pub(crate) use tracker::Track; pub(crate) use translation::{TranslatedDocument, TranslationData}; pub use {doc::resolve_foreign_variable2, doc::resolve_import}; -pub const FASTN_UI_INTERFACE: &str = "fastn-stack.github.io/fastn-ui"; +pub const FASTN_UI_INTERFACE: &str = "fastn-ui.fifthtry-site"; pub const PACKAGE_THEME_INTERFACE: &str = "ftd-lang.github.io/theme"; pub const NUMBER_OF_CRS_TO_RESERVE: usize = 5; diff --git a/ftd/src/interpreter/utils.rs b/ftd/src/interpreter/utils.rs index eec8843160..8d253a9120 100644 --- a/ftd/src/interpreter/utils.rs +++ b/ftd/src/interpreter/utils.rs @@ -330,6 +330,11 @@ pub fn get_argument_for_reference_and_remaining( )>, > { if let Some((component_name, arguments)) = component_definition_name_with_arguments { + // Since we allow '.' in package names now which was not previously allowed + // To handle cases: (When package/site name starts with the component name) + // name: app-switcher.fifthtry-site#app-switcher.is-open + let name = name.trim_start_matches(format!("{}#", doc.name).as_str()); + if let Some(referenced_argument) = name .strip_prefix(format!("{}.", component_name).as_str()) .or_else(|| name.strip_prefix(format!("{}#{}.", doc.name, component_name).as_str())) From 95ef33d7f850a44500dbe9ee5c376c1402e3f5ab Mon Sep 17 00:00:00 2001 From: heulitig Date: Fri, 5 Apr 2024 14:19:03 +0530 Subject: [PATCH 2/2] minor fixes --- fastn-core/src/lib.rs | 2 +- ftd/src/interpreter/utils.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/fastn-core/src/lib.rs b/fastn-core/src/lib.rs index cdc49d7fc7..ad15a92296 100644 --- a/fastn-core/src/lib.rs +++ b/fastn-core/src/lib.rs @@ -48,7 +48,7 @@ pub(crate) use tracker::Track; pub(crate) use translation::{TranslatedDocument, TranslationData}; pub use {doc::resolve_foreign_variable2, doc::resolve_import}; -pub const FASTN_UI_INTERFACE: &str = "fastn-ui.fifthtry-site"; +pub const FASTN_UI_INTERFACE: &str = "fastn-ui.fifthtry.site"; pub const PACKAGE_THEME_INTERFACE: &str = "ftd-lang.github.io/theme"; pub const NUMBER_OF_CRS_TO_RESERVE: usize = 5; diff --git a/ftd/src/interpreter/utils.rs b/ftd/src/interpreter/utils.rs index 8d253a9120..76fe8f0d0f 100644 --- a/ftd/src/interpreter/utils.rs +++ b/ftd/src/interpreter/utils.rs @@ -330,7 +330,6 @@ pub fn get_argument_for_reference_and_remaining( )>, > { if let Some((component_name, arguments)) = component_definition_name_with_arguments { - // Since we allow '.' in package names now which was not previously allowed // To handle cases: (When package/site name starts with the component name) // name: app-switcher.fifthtry-site#app-switcher.is-open let name = name.trim_start_matches(format!("{}#", doc.name).as_str());