-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instructions for people who cannot install the prototype kit on their computers (Issue/70) #152
base: main
Are you sure you want to change the base?
Changes from 13 commits
4788d10
e1a5bb0
c5d845b
7694838
ecbd2ad
f2f07e7
1aae5e2
8f0157a
f7896fe
48062d4
ab22cee
2473379
4cdd8d1
dfe0410
6c96cd8
89e47bb
2d2a320
ee53a18
17d4474
b529b94
b4644df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"name": "NHS Prototype Kit", | ||
"image": "mcr.microsoft.com/devcontainers/universal:2", | ||
// codespaces seems to have an issue using port 2000 so setting to 2001 for the NHS Prototype Kit | ||
"runArgs": ["--env", "PORT=2001"], | ||
"portsAttributes": { | ||
"3001": { | ||
"label": "Running prototype", | ||
// -------------------------------- | ||
// onAutoForward possible options | ||
// -------------------------------- | ||
// you can change the value to one of the following possible options: | ||
// 'notify' (shows a prompt), | ||
// 'silent' (does nothing) | ||
// 'openBrowser' (opens the prototype URL in a browser window/tab) | ||
// 'openPrview' (opens the codespaces preview window to present the running prototype to the user) | ||
"onAutoForward": "openPreview" | ||
} | ||
}, | ||
// forward the port for the browersync process | ||
"forwardPorts": [3001], | ||
"otherPortsAttributes": { "onAutoForward": "ignore" }, | ||
// when created - sets the git merge statergy to rebase to hopefully make easier time of merging | ||
"onCreateCommand": "git config --global pull.rebase true", | ||
// after creation - installs the node packages | ||
"postCreateCommand": "npm install", | ||
// A command to run each time a tool has successfully attached to the container | ||
"postAttachCommand": { | ||
"server": "npm run watch" | ||
}, | ||
// codespace customisations | ||
"customizations": { | ||
// Configure properties specific to VS Code web-basde IDE used within codespaces. | ||
"vscode": { | ||
// editor settings | ||
"settings": { | ||
// uncomment the following lines to hide files not needed to update content | ||
// "files.exclude": { | ||
// "{docs,lib,linters,middleware,node_modules,public,tests,NHS111.Shared.Frontend}/": true, | ||
// "*{CHANGELOG,CONTRIBUTING}.md": true, | ||
// "app/{data,assets}/": true, | ||
// "app/*.js": true, | ||
// "*.{js,yml,json}": true, | ||
// ".*": true, | ||
// "LICENSE": true | ||
// }, | ||
// make emmet work within nunjucks | ||
"emmet.includeLanguages": { | ||
"njk": "html", | ||
"nunjucks": "html", | ||
"erb": "html", | ||
"jinja": "html", | ||
"jinja-html": "html", | ||
"markdown": "html" | ||
}, | ||
"html.suggest.html5": true | ||
}, | ||
// bundle the following editor extensions | ||
"extensions": [ | ||
// nunjuck syntax highlighting | ||
"douglaszaltron.nunjucks-vscode-extensionpack" | ||
] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{% set installEnvironment = "Codespaces" %} | ||
{% set steps_total = "2" %} | ||
|
||
{% extends 'layout.html' %} | ||
|
||
{% block beforeContent %} | ||
{{ breadcrumb({ | ||
items: [ | ||
{ | ||
href: "/", | ||
text: "Home" | ||
}, | ||
{ | ||
href: "/install/", | ||
text: "Get started" | ||
} | ||
], | ||
href: "/install/codespaces/", | ||
text: "Install and use the kit with your web browser" | ||
}) }} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="nhsuk-grid-row"> | ||
<div class="nhsuk-grid-column-two-thirds"> | ||
|
||
<h1> | ||
<span class="nhsuk-caption-l">Step | ||
{{ current_step }} | ||
of | ||
{{ steps_total }}{{[":", installEnvironment ] | join(" ") if installEnvironment }}</span> | ||
{% block stepHeader %}{% endblock %} | ||
</h1> | ||
|
||
{% block page_content %}{% endblock %} | ||
|
||
{% block pagination %}{% endblock %} | ||
|
||
</div> | ||
</div> | ||
{% endblock %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{% set installEnvironment = "Codespaces" %} | ||
{% set current_step = '1' %} | ||
|
||
{% block pageTitle %} | ||
Create a codespace - NHS prototype kit | ||
{% endblock %} | ||
|
||
{% extends 'install/codespace.html' %} | ||
|
||
{% block beforeContent %} | ||
{{ breadcrumb({ | ||
items: [ | ||
{ | ||
href: "/", | ||
text: "Home" | ||
}, | ||
{ | ||
href: "/install/codespaces/", | ||
text: "Install the kit in your web browser" | ||
} | ||
] | ||
}) }} | ||
{% endblock %} | ||
|
||
{% block stepHeader %} | ||
Create a Codespace | ||
{% endblock %} | ||
|
||
{% block page_content %} | ||
|
||
<p class="nhsuk-lede-text">To use the kit within a Codespace you will first need to create one.</p> | ||
|
||
<h2>1. Go to the prototype repository</h2> | ||
|
||
<p>Go to the GitHub repository for the prototype you wish to use. For this guide we will be starting a new prototype, using the | ||
<a href="https://github.com/nhsuk/nhsuk-prototype-kit">NHS prototype kit repository</a>. | ||
</p> | ||
|
||
<p>If you using an existing prototype, go to step 2.</p> | ||
|
||
<p>If you are starting a new prototype: copy the prototype kit files to your GitHub organisation. You can do this by 'forking' the repository.</p> | ||
frankieroberto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<p><img class="app-img-guide nhsuk-u-margin-bottom-0" alt="Location of the fork button on the repository page" src="/images/codespaces/fork-button.png"></p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should avoid recommend using the 'fork' feature as that might cause some unexpected issues - eg if it defaults pull requests to being against the upstream repo instead of the forked one? That said, the alternative right now would be to download the zip file and re-upload it which isn't ideal either. Maybe it’s time to start looking at setting up a template repo sooner rather than later? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm yes you're right, forking is not right, didn't realise how it maintains a connection to the main repo. But following the normal way of downloading a zip to you computer then linking that up with a git repo then gets us back to doing stuff on your local machine… Don't know about templates but sounds like it could be what we're looking for. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll change it to reference the download and re-upload process for now, even if that’s a bit of a pain. It should still be helpful for people who can install Visual Studio or GitHub Desktop, but can't get Node.js running. Will spin out a separate issue to investigate template repos.
frankieroberto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<p>Ask your development team or technical leadership where you should store your prototype and how to get access.</p> | ||
|
||
<h2>2. Create a new Codespace</h2> | ||
|
||
<p>On every Github repository page is a 'Code' button which is used to get a copy of or to use the code held within the git repository.</p> | ||
|
||
<p>Locate the button, click it, a dialogue box will open, at the top of the dialogue click the 'Codespaces' tab.</p> | ||
<p>Next click on the 'Create codespace on main' button. Which will open your new codespace in a new browser tab or window.</p> | ||
|
||
<p><img class="app-img-guide nhsuk-u-margin-bottom-0" alt="Screenshot of the location of create a codespace on main button" src="/images/codespaces/create-a-codespace.png"></p> | ||
<p>The 'Create codespace on main' button will either be shown as a large button or a small plus symbol after the label 'your workspaces in the cloud'.</p> | ||
|
||
<h2>3. Wait for the Codespace setup to finish</h2> | ||
|
||
<p>The Codespace will open in a new tab (or window) and begin the setup process.</p> | ||
|
||
<p>You will see an interface building with a progress message showing that the space (known as a 'container') is being created or rebuilt.</p> | ||
|
||
<p>This can take between 30 seconds and 5 minutes.</p> | ||
|
||
<h2>4. Check that it has worked</h2> | ||
|
||
<p>Once the Codespace has been created, you will then see the 'terminal' tab with commands being exectuted to start the prototype kit.</p> | ||
<p>When the prototype has started it will open a preview window displaying the homepage of the prototype.</p> | ||
|
||
<!-- <h2>5. Codespace setup complete</h2> --> | ||
frankieroberto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<p><img class="app-img-guide nhsuk-u-margin-bottom-0" alt="Screenshot of the running codespace" src="/images/codespaces/running-codespace.png"></p> | ||
|
||
<p>You now have a copy of the NHS prototype kit installed and running within a new GitHub Codespace.</p> | ||
|
||
<p>This means you can create and edit prototypes entirely in your browser.</p> | ||
|
||
{% endblock %} | ||
|
||
{% block pagination %} | ||
{{ pagination({ | ||
"previousUrl": "/install/codespaces/index", | ||
"previousPage": "Get started", | ||
"nextUrl": "/install/codespaces/working-with-codespaces", | ||
"nextPage": "Step 2: Working with Codespaces" | ||
}) }} | ||
{% endblock %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{% extends 'layout.html' %} | ||
|
||
{% block pageTitle %} | ||
Install and use the kit with your web browser - NHS prototype kit | ||
{% endblock %} | ||
|
||
{% block beforeContent %} | ||
{{ breadcrumb({ | ||
items: [ | ||
{ | ||
href: "/", | ||
text: "Home" | ||
}, | ||
{ | ||
href: "/install/", | ||
text: "Get started" | ||
} | ||
] | ||
}) }} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="nhsuk-grid-row"> | ||
<div class="nhsuk-grid-column-two-thirds"> | ||
|
||
<h1 class="nhsuk-heading-xl">Install and use the kit with your web browser</h1> | ||
|
||
<p class="nhsuk-body-l">If you cannot install the kit on your computer (for example, beause you are not allowed to install Node.js) you can use an online service to edit and run code using your web browser.</p> | ||
|
||
<p>Services that you can use include:<p> | ||
|
||
<ul> | ||
<li> | ||
<a href="https://github.com/features/codespaces">GitHub Codespaces</a> – free for around 60 hours per month | ||
</li> | ||
<li> | ||
<a href="https://www.gitpod.io/">Gitpod</a> – free for around 50 hours per month | ||
</li> | ||
</ul> | ||
|
||
<p>For this guide we are using GitHub Codespaces.</p> | ||
|
||
<h2 class="nhsuk-heading-l">Before you begin</h2> | ||
|
||
<p>You do not need any technical knowledge to use this guide.</p> | ||
|
||
<p>You will need a | ||
<a href="https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out">GitHub account</a>. | ||
</p> | ||
|
||
<p>We will show you how to:</p> | ||
<ul class="nhsuk-list nhsuk-list--bullet"> | ||
<li>set up the Codespace | ||
</li> | ||
<li>work with the Codespace</li> | ||
</ul> | ||
<p> | ||
Installation usually takes up to 5 minutes. | ||
</p> | ||
|
||
{{ actionLink({ text: "Start guide for using the kit in a web browser", href: "/install/codespaces/create-a-codespace", classes: "nhsuk-u-margin-top-x nhsuk-heading-l" }) }} | ||
|
||
</div> | ||
</div> | ||
{% endblock %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{% set installEnvironment = "Codespaces" %} | ||
{% set current_step = 2 %} | ||
|
||
{% block pageTitle %} | ||
Editing the kit with Codespaces - NHS prototype kit | ||
{% endblock %} | ||
|
||
{% extends 'install/codespace.html' %} | ||
|
||
{% block beforeContent %} | ||
{{ breadcrumb({ | ||
items: [ | ||
{ | ||
href: "/", | ||
text: "Home" | ||
}, | ||
{ | ||
href: "/install/codespaces/", | ||
text: "Install the kit in your web browser" | ||
} | ||
] | ||
}) }} | ||
{% endblock %} | ||
|
||
{% block stepHeader %} | ||
Editing the kit with Codespaces | ||
{% endblock %} | ||
|
||
{% block page_content %} | ||
|
||
<p class="nhsuk-lede-text">If you are using the browser to edit the kit, you need to manage changes in Codespaces.</p> | ||
|
||
<h2>Save changes</h2> | ||
|
||
<p>Any changes you make are not shared with anybody else until you commit them to Git and push them to the repository.</p> | ||
|
||
<p>You can use the Codespace code editor and user interface to manage changes with GitHub. You can use the | ||
<a href="https://docs.github.com/en/codespaces/getting-started/quickstart">quickstart guide to working with Codespaces</a> | ||
frankieroberto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</p> | ||
|
||
<h2>Manage prototypes</h2> | ||
|
||
<p>When a Codespace is deleted, you will lose any uncommitted and unpushed changes.</p> | ||
<p>GitHub Codespaces are automatically deleted after they have been stopped and have remained inactive for a defined number of days, by default this is 30 days.</p> | ||
|
||
|
||
|
||
<h2>Publish prototypes online</h2> | ||
|
||
<p>Codespaces are temporary and do not usually have passwords. Do not use them to <a href='/how-tos/publish-your-prototype-online'>publish your prototypes online</a>.</p> | ||
|
||
<h2>Get going</h2> | ||
|
||
<p> | ||
<a href="/how-tos/build-basic-prototype/index">Build a basic prototype</a> | ||
or | ||
<a href="/how-tos/index">view other guides</a>.</p> | ||
|
||
{% endblock %} | ||
|
||
{% block pagination %} | ||
{{ pagination({ | ||
"previousUrl": "/install/codespaces/create-a-codespace", | ||
"previousPage": "Step 1: Create a Codespace" | ||
}) }} | ||
{% endblock %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think we need to include this file as this would just enable you to run the documentation website in Codespaces, rather than the kit itself, which is over here: https://github.com/nhsuk/nhsuk-prototype-kit/
But it might be useful to include anyway to allow us to try it out for making changes to the website?