From d3e0003dab534b072152d7bdecf0bd40644ac068 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sat, 17 Sep 2022 03:24:56 +0100 Subject: [PATCH] Include setup instructions on crate overview --- chartered-frontend/Dockerfile | 2 ++ book/src/getting-started/user-guide.md | 2 +- chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/+page.svelte | 26 ++++++++++++++++++++++++++ chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/DependencyDefinition.svelte | 16 ++++++++++++++++ chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/RegistryDefinition.svelte | 9 +++++++++ 5 files changed, 54 insertions(+), 1 deletion(-) diff --git a/chartered-frontend/Dockerfile b/chartered-frontend/Dockerfile index de0b066..571a682 100644 --- a/chartered-frontend/Dockerfile +++ a/chartered-frontend/Dockerfile @@ -1,6 +1,8 @@ FROM node AS builder ARG VITE_CHARTERED_WEB_URL +ARG VITE_CHARTERED_SSH_URL RUN ["/bin/bash", "-c", ": ${VITE_CHARTERED_WEB_URL:?VITE_CHARTERED_WEB_URL must be set to the public URL that chartered-web can be reached by passing --build-arg to docker build.}"] +RUN ["/bin/bash", "-c", ": ${VITE_CHARTERED_SSH_URL:?VITE_CHARTERED_SSH_URL must be set to the SSH URL that chartered-git can be reached by passing --build-arg to docker build.}"] WORKDIR /app COPY . /app RUN npm install -D && npm run build diff --git a/book/src/getting-started/user-guide.md b/book/src/getting-started/user-guide.md index 4623393..ef4890b 100644 --- a/book/src/getting-started/user-guide.md +++ a/book/src/getting-started/user-guide.md @@ -49,7 +49,7 @@ ```toml [registries] -my-organisation = { index = "ssh://ssh.your.instance.of.chart.rs/my-organisation" } +my-organisation = { index = "ssh://ssh.chart.rs/my-organisation" } ``` (You should create this file if it doesn't already exist) diff --git a/chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/+page.svelte b/chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/+page.svelte index 501024e..aa173ee 100644 --- a/chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/+page.svelte +++ a/chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/+page.svelte @@ -8,6 +8,8 @@ import Dependency from './Dependency.svelte'; import VersionTab from './VersionTab.svelte'; import MemberTab from './MemberTab.svelte'; + import RegistryDefinition from './RegistryDefinition.svelte'; + import DependencyDefinition from './DependencyDefinition.svelte'; // lookup the crate currently requested by the user based on the URL let cratePromise: Promise; @@ -203,6 +205,30 @@
+ {#if import.meta.env.VITE_CHARTERED_SSH_URL} +
+

Get Started

+ +
+
+ .cargo/config.toml + +
+
+
+
+ +
+ Cargo.toml + +
+
+
+
+
+
+ {/if} +

Dependencies

diff --git a/chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/DependencyDefinition.svelte b/chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/DependencyDefinition.svelte new file mode 100644 index 0000000..c91a69b 100644 --- /dev/null +++ a/chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/DependencyDefinition.svelte @@ -1,0 +1,16 @@ + + +[dependencies] +{$page.params.crate} = {`{ version = "${version}", registry = "${$page.params.organisation}" }`} diff --git a/chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/RegistryDefinition.svelte b/chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/RegistryDefinition.svelte new file mode 100644 index 0000000..5ba6f6e 100644 --- /dev/null +++ a/chartered-frontend/src/routes/(authed)/crates/[organisation]/[crate]/RegistryDefinition.svelte @@ -1,0 +1,9 @@ + + +[registries] +{$page.params.organisation} = {`{ index = "${indexUri}" }`} -- rgit 0.1.3