Unison Shareis Unison's own code hosting service. Unison's unique code format and tooling enables different strategies for remote repositories. We created Unison Share to support code hosting, library discovery, collaboration, source code viewing, and documentation rendering.
🏗️This document describes how to perform common interactions with Unison Share. We'll add more here as more functionality gets added to the platform.
Pushing and pulling code
First, You'll want to make sure you're logged in to the Unison Share platform. Runauth.login
in the UCM locally.
.> auth.login
This will open your default web browser and prompt you to log into Unison Share.
To push a project, use thepush
command from inside the project and branch you're hoping to share. This pushes themain
branch to @username/myProject/main.
myProject/main> push
To push a namespace, use thepush
command from inside the namespace you're hoping to share, or use a fully qualified name (one which starts with a dot,.
)as the second argument to the command.
.> push myUser.public.myCode .myCode
To bring a remote namespace into your local codebase, issue thepull
command in the UCM.
myProject> pull myUser.public.myProject.main .myProject
Library structure conventions
For the best experience hosting a library on Unison Share, we recommendcreating a projectwhere themain
branch represents the latest work in progress, feature branches are used for concurrent workstreams, and release branches or release drafts are snapshots of themain
branch at a given point in time.
myProject
/main
README
ReleaseNotes
lib
dependencies
/featureBranch
-- fork of main
/releases/draft/X.Y.Z
-- snapshots of main
Inside themain
branch of your project, located just under the project root, you should have alib
namespace to contain your library's dependencies. Optionally you can include aREADME
documentat the root of your project code. If present, Unison Share will automatically render the README as the landing page of the project.
Another special document you can include at the root of your project isReleaseNotes
,which will be rendered as the release notes for the latest release of your library. This is a good place to include information about how to upgrade from previous versions, or any other information you'd like to convey to users of your library. If Unison Share detects aReleaseNotes
term in your project, it will automatically render it as the release notes for the latest release of your library.
Consumers of your library hoping to obtain the most recent released version of the library would pull@user/project/releases/X.Y.Z
,whereas fellow maintainers would likely choose toclone
themain
branch to keep in sync with active development. Once a new release is ready, you can hit the "release" button in the Unison Share UI to create a release frommain
.Read more about creating library releases here.