Browse Source

feat(ngit): add ngit guide and install pointers

as ngit and gitworkshop are so intertwined there should be pointers to
encourage users to install and work with the ngit client alongside
gitworkshop
master
DanConwayDev 2 years ago
parent
commit
8fff6fdce2
No known key found for this signature in database
GPG Key ID: 68E15486D73F75E1
  1. 49
      src/routes/+page.svelte
  2. 85
      src/routes/ngit/+page.svelte
  3. 24
      src/routes/repo/[repo_id]/pr/[pr_id]/+page.svelte

49
src/routes/+page.svelte

@ -5,13 +5,48 @@ @@ -5,13 +5,48 @@
<div class="flex flex-row">
<div class="hero bg-pr h-[calc(100vh-4rem)] md:basis-1/2">
<div class="hero-content text-center">
<div class="max-w-md prose">
<h1 class="mb-2">
<span class="text-purple-600">git</span><span class="text-white"
>workshop</span
><span class="text-neutral">.dev</span>
</h1>
<p class="mt-3">permissionless alternative to GitHub over nostr</p>
<div class="max-w-md">
<div class="prose">
<h1 class="mb-2">
<span class="text-purple-600">git</span><span class="text-white"
>workshop</span
><span class="text-neutral">.dev</span>
</h1>
<p class="mt-3 mb-8">
permissionless alternative to GitHub over nostr
</p>
</div>
<div>
<div class="bg-base-300 card mb-8">
<div class="card-body items-center text-center">
<div class="card-title">
<h3>
pairs with <span class="text-purple-600">n</span>git cli
</h3>
</div>
<div class="prose">
a command-line tool to <span class="badge">create</span>,
<span class="badge">list</span> and
<span class="badge">apply</span> PRs and patches
<div class="card-actions flex mt-3">
<div class="flex-grow">
<a href="/ngit" class="btn btn-neutral">install ngit</a>
</div>
<div class="flex-grow">
<a href="/ngit" class="btn">learn more</a>
</div>
</div>
</div>
</div>
</div>
</div>
<button
on:click={() =>
alert(
"install ngit and run `ngit claim` your local git repository",
)}
class="btn btn-secondary">list your repository</button
>
</div>
</div>
</div>

85
src/routes/ngit/+page.svelte

@ -0,0 +1,85 @@ @@ -0,0 +1,85 @@
<script lang="ts">
import Container from "$lib/components/Container.svelte";
</script>
<Container>
<div class="prose mt-8 m-auto">
<h2 class=""><span class="text-purple-600">n</span>git</h2>
<p>
a command-line tool to create, list and apply PRs and patches to git
repositories via nostr events.
</p>
It is designed to work seemlessly with this site gitworkshop.dev.
<h3>Install</h3>
<p>
If you have cargo installed run<code>cargo install ngit</code>.
Alternatively download:
</p>
<a
href="https://github.com/DanConwayDev/ngit-cli/releases/download/v0.1.0/ngit-x86_64-unknown-linux-gnu.tar.gz"
class="btn btn-neutral">Linux</a
>
<a
href="https://github.com/DanConwayDev/ngit-cli/releases/download/v0.1.0/ngit-x86_64-pc-windows-msvc.zip"
class="btn btn-neutral">Mac</a
>
<a
href="https://github.com/DanConwayDev/ngit-cli/releases/download/v0.1.0/ngit-x86_64-apple-darwin.tar.gz"
class="btn btn-neutral">Windows</a
>
v.0.1.0
<p>add the binary to a directory from which it can be run globally.</p>
<h3>Commands</h3>
<p>
All commands should be run from the directory of the git repository
</p>
<p>
<span class="rounded p-2 bg-neutral font-mono"
><span class="py-5">ngit prs create</span></span
>
use this when you are on a feature branch to propose it gets merged into
the remote branch by repository maintainer.
</p>
<p>
It creates a PR event and patch events for each commit that isn't
also in the main or master branch.
</p>
<p>
<span class="rounded p-2 bg-neutral font-mono"
><span class="py-5">ngit prs list</span></span
>
fetches a selectable list of open PRs and, if one is selected and the
repository is clean, will create a branch for it and apply the commits.
If the branch already exists it will pull any updates.
</p>
<p>
<span class="rounded p-2 bg-neutral font-mono"
><span class="py-5">ngit pull</span></span
>
if the repository is currently in a branch related to an existing PR,
it will pull any updates from nostr.
</p>
<p>
<span class="rounded p-2 bg-neutral font-mono"
><span class="py-5">ngit push</span></span
>
if the repository is currently in a branch related to an existing PR,
it will create patch events for any new commits.
</p>
<p>
<span class="rounded p-2 bg-neutral font-mono"
><span class="py-5">ngit claim</span></span
>
issue a repository nostr event which lists it on gitworkshop.dev and
indicates you are accepting patches and PRs via nostr.
</p>
<p>
It also creates an optional <span class="font-mono p-2 bg-base-200"
>maintainers.yaml</span
> file in the root of your repo that lists maintainers and relays. If
commited it will make it smoother for contributors to find your repository
event and also makes any future transfer of repository ownership easier.
</p>
</div>
</Container>

24
src/routes/repo/[repo_id]/pr/[pr_id]/+page.svelte

@ -65,6 +65,30 @@ @@ -65,6 +65,30 @@
<div class="prose my-3">
{$selected_pr_full.summary.descritpion}
</div>
<div role="alert" class="alert">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
class="stroke-info shrink-0 w-6 h-6"
><path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
></path></svg
>
<div>
<h3 class="text-xs prose">
to view the latest patches from this PR <a
href="/ngit">install ngit</a
>, run
<span class="rounded p-1 bg-neutral font-mono"
><span class="py-3">ngit prs list</span></span
> from the local repository and select this PR title
</h3>
</div>
</div>
{#if $selected_pr_full.pr_event}
<Thread
event={$selected_pr_full.pr_event}

Loading…
Cancel
Save