Skip to content

Instantly share code, notes, and snippets.

@ab5tract
Last active January 1, 2025 22:01
Show Gist options
  • Save ab5tract/5a647bff73e5fff276b3f1aec581c933 to your computer and use it in GitHub Desktop.
Save ab5tract/5a647bff73e5fff276b3f1aec581c933 to your computer and use it in GitHub Desktop.
Fix for Cromponent PR#9 (maybe?)
diff --git a/lib/Cromponent.rakumod b/lib/Cromponent.rakumod
index 1bb5708..339046d 100644
--- a/lib/Cromponent.rakumod
+++ b/lib/Cromponent.rakumod
@@ -234,8 +234,12 @@ sub cromponent-library($component) is export {
multi EXPORT(--> Map()) {
'&trait_mod:<is>' => &trait_mod:<is>,
- '&EXPORT' => sub {
- [|@components-sub, |@components-macro].map({ |cromponent-library $_ }).Map
+ '&EXPORT' => sub {
+ BEGIN {
+ use Cro::WebApp::Template::Repository;
+ my $*TEMPLATE-REPOSITORY = get-template-repository;
+ [|@components-sub, |@components-macro].map({ |cromponent-library $_ }).Map;
+ }
},
}
diff --git a/lib/Cromponent.rakumod b/lib/Cromponent.rakumod
index 1bb5708..62411c7 100644
--- a/lib/Cromponent.rakumod
+++ b/lib/Cromponent.rakumod
@@ -234,8 +234,12 @@ sub cromponent-library($component) is export {
multi EXPORT(--> Map()) {
'&trait_mod:<is>' => &trait_mod:<is>,
- '&EXPORT' => sub {
- [|@components-sub, |@components-macro].map({ |cromponent-library $_ }).Map
+ '&EXPORT' => sub {
+ my % will begin -> %m {
+ use Cro::WebApp::Template::Repository;
+ my $*TEMPLATE-REPOSITORY = get-template-repository;
+ %m = [|@components-sub, |@components-macro].map({ |cromponent-library $_ }).Map;
+ }
},
}
diff --git a/lib/Cromponent.rakumod b/lib/Cromponent.rakumod
index 1bb5708..668d2de 100644
--- a/lib/Cromponent.rakumod
+++ b/lib/Cromponent.rakumod
@@ -234,8 +234,13 @@ sub cromponent-library($component) is export {
multi EXPORT(--> Map()) {
'&trait_mod:<is>' => &trait_mod:<is>,
- '&EXPORT' => sub {
- [|@components-sub, |@components-macro].map({ |cromponent-library $_ }).Map
+ '&EXPORT' => sub {
+ my %export-map will begin -> %m {
+ use Cro::WebApp::Template::Repository;
+ my $*TEMPLATE-REPOSITORY = get-template-repository;
+ %m = [|@components-sub, |@components-macro].map({ |cromponent-library $_ }).Map;
+ }
+ %export-map
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment