Provide tools for building paclet sites, especially on a remote git repository.
A paclet site is a (local or cloud) directory, with two necessary components in it:
- Directory
"Paclets"
: includes all paclet files. - File
"PacletSite.mz"
: ZIP compressed, contains only one file:- File
"PacletSite.m"
: Wolfram Language package file, contains only one expression:- Expression: an expression that matches pattern
PacletSite[Paclet[___Rule]...]
.- The inner
Paclet
expressions are almost the same to those in thePacletInfo.m
of your paclets - you can convert them to each other withPacletSiteManager`PacletExpressionConvert
provided by this package.
- The inner
- Expression: an expression that matches pattern
- File
- Any Wolfram Kernel of version 11+.
- Only 12.0.0.0, 12.2.0.0 are tested.
wget
for downloading paclets from internet.- If you have nothing to do with a remote paclet site, this is not needed.
cat
shell command available for catenate files,split
command for split files.- Only cygwin on Windows 10 and Linux tested.
- Paclet splitting is not supported by the official paclet manager, so usually you won't need this feature.
PacletInstall["PacletSiteManager", "Site" -> "https://github.com/rnotlnglgq/WolframPacletSiteManager/raw/master"]
Register site (only once needed)
PacletManager`PacletSiteAdd["https://github.com/rnotlnglgq/WolframPacletSiteManager/raw/master"]
Install or update:
PacletInstall["PacletSiteManager"]
This paclet will be automatically loaded when its symbols are evaluated. And it assumes the Directory[]
has been set to the root path of the paclet site.
-
To generate
PacletSite.mz
file fromPaclets
directory, simply put paclet files in the directoryPaclets/
and then evaluatePutSiteInfo[]
. -
To search paclets from a paclet site, try
PacletSearch
andPacletQuery
. -
To make your paclet site synchronous with a remote paclet site, write your requirement to the
$RequirementFile
(you can useGetRequirementInfo[expr_]
to see its format and generate it from paclets). And then tryListRequiredPaclet
andListPacletChanges
.
The documentation is far from finished. Feel free to contact me if you need help.
GetSiteInfo[1]
generatesPacletSite
expression from"Paclets/*.paclet" -> "PacletInfo.*"
GetSiteInfo[2]
readsPacletSite
expression from"PacletSite.mz"
GetSiteInfo[3]
readsPacletSite
expression from"PacletSite.mz"
GetSiteInfo[4]
readsPacletSite
expression from$RemotePacletSite
(default as"https://pacletserver2.wolfram.com/PacletSite.mz"
)PutSiteInfo[expr_]
exportsexpr
toFileNameJoin@{Directory[], "Paclets"}
PutSiteInfo[i_Integer]
is equivalent toPutSiteInfo@GetSiteInfo[i]
-
PacletExpressionConvert[i_Integer]
convertPaclet
expressions to type-i:- Type-1 is for
"PacletSite.mz"
- Type-2 is for
PacletInfo.m
. Type-2 will be required by most functions in this package - Type-3 is in the
PacletObject
form.
Note: the head of all of these expressions will be in the context
PacletSiteManager`Private`
, instead ofSystem`
orPacletManager`
! - Type-1 is for
{
$Downloader,
$VersionStringComplete,
$RemotePacletSite,
$PartSize,
$RequirementFile,
ApplyPacletChanges,
BlockedExport,
BlockedImport,
BuildTreeBySeries,
CatenateParts,
DownloadCommand,
DownloadPaclet,
DownloadRequest,
ExportURLList,
GetPacletInfo,
GetPacletValue,
GetRequirementInfo,
GetSiteInfo,
GroupByValue,
KernelVersionMatchQ,
ListPacletChanges,
ListRequiredPaclet,
PacletExpressionConvert,
PacletList,
PacletPartList,
PacletQuery,
PacletSearch,
PartsRegularize,
PutRequirementInfo,
PutSiteInfo,
SiteRegularize,
SortByVersion,
SplitPaclet,
ValidPacletFileQ,
ValidPacletQ
}
See issues.
- Write platform requirements in the requirement file and then use it for more useful functions.
- Still testing
- This package does not require any function from the official paclet manger.
- This package is developed due to the requirement of
WolframPacletMirror
for China users. Original written by asdasd1dsadsa.