Here is an overloading sugestion:
Unprotect@File;
File/:DatabinAdd[mybin_Databin, File[packPath_]]:=Module[{},
DatabinAdd[mybin, <|FileBaseName@packPath<>"`"->Import[packPath,"Text"]|>]
]
Protect@File;
So, to add you package into a Databin, just do:
DatabinAdd[Databin["3GUtgBVI"], File["/Desktop/dropTest.wl"]]
Now, to load it, let's work with Get:
Unprotect@Get;
Get[pack_String,Databin[id_String]]:=Module[{databin=Databin[id]},
Get[pack,databin]
]
Get[pack_String,databin_Databin]:=Module[{packContent,path},
packContent=Lookup[databin["Values"],pack,Return[$Failed]][[1]];
path=FileNameJoin@{$TemporaryDirectory,StringReplace[pack,"`"-> ""]<>".wl"};
Export[path, packContent, "Text"];
Get[Evaluate@path]
]
Protect@Get;
Now, to load you package, just do:
Get["dropTest`", Databin["3GUtgBVI"]]
now:
myFunc[1]
2