Skip to content

Commit 18fd080

Browse files
committed
Firrrrrrst!
0 parents  commit 18fd080

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+14128
-0
lines changed

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.sass-cache
2+
.DS_Store
3+
.start.pid
4+
public
5+
govuk_modules
6+
node_modules/*
7+
*.sublime-*
8+
docs

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 1.0.0
2+
3+
Initial release of prototyping kit

CONTRIBUTING.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contribution guidelines
2+
3+
We really like contributions and bug reports, in fact the project wouldn't have got to this stage without them.
4+
We do have a few guidelines to bear in mind.
5+
6+
## GOV.UK Elements
7+
8+
The project contains code taken from the [GOV.UK Elements](https://github.com/alphagov/govuk_elements/) project.
9+
Please check that any issues related to that code are raised with that project, not this one.
10+
11+
## Raising bugs
12+
13+
When raising bugs please explain the issue in good detail and provide a guide to how to replicate it.
14+
When describing the bug it's useful to follow the format:
15+
16+
- what you did
17+
- what you expected to happen
18+
- what happened
19+
20+
## Suggesting features
21+
22+
Please raise feature requests as issues before contributing any code.
23+
This is just to ensure they are discussed properly before any time is spent on them.
24+
25+
## Contributing code
26+
27+
### Indentation and whitespace
28+
29+
2-space, soft-tabs only please. No trailing whitespace.
30+
31+
### Versioning
32+
33+
We use [semantic versioning](http://semver.org/), and bump the version
34+
on master only. Please don't submit your own proposed version numbers.
35+
36+
### Commit hygiene
37+
38+
Please see our [git style guide](https://github.com/alphagov/styleguides/blob/master/git.md)
39+
which describes how we prefer git history and commit messages to read.

Gruntfile.js

+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
module.exports = function(grunt){
2+
grunt.initConfig({
3+
// Clean
4+
clean: ['public', 'govuk_modules'],
5+
6+
// Builds Sass
7+
sass: {
8+
dev: {
9+
options: {
10+
style: "expanded",
11+
sourcemap: true,
12+
includePaths: [
13+
'govuk_modules/govuk_template/assets/stylesheets',
14+
'govuk_modules/govuk_frontend_toolkit/stylesheets'
15+
],
16+
outputStyle: 'expanded'
17+
},
18+
files: [{
19+
expand: true,
20+
cwd: "app/assets/sass",
21+
src: ["*.scss"],
22+
dest: "public/stylesheets/",
23+
ext: ".css"
24+
}]
25+
}
26+
},
27+
28+
// Copies templates and assets from external modules and dirs
29+
copy: {
30+
assets: {
31+
files: [{
32+
expand: true,
33+
cwd: 'app/assets/',
34+
src: ['**/*', '!sass/**'],
35+
dest: 'public/'
36+
}]
37+
},
38+
govuk: {
39+
files: [{
40+
expand: true,
41+
cwd: 'node_modules/govuk_frontend_toolkit',
42+
src: '**',
43+
dest: 'govuk_modules/govuk_frontend_toolkit/'
44+
},
45+
{
46+
expand: true,
47+
cwd: 'node_modules/govuk_template_mustache/',
48+
src: '**',
49+
dest: 'govuk_modules/govuk_template/'
50+
}]
51+
},
52+
},
53+
54+
// workaround for libsass
55+
replace: {
56+
fixSass: {
57+
src: ['govuk_modules/govuk_template/**/*.scss', 'govuk_modules/govuk_frontend_toolkit/**/*.scss'],
58+
overwrite: true,
59+
replacements: [{
60+
from: /filter:chroma(.*);/g,
61+
to: 'filter:unquote("chroma$1");'
62+
}]
63+
}
64+
},
65+
66+
// Watches assets and sass for changes
67+
watch: {
68+
css: {
69+
files: ['app/assets/sass/**/*.scss'],
70+
tasks: ['sass'],
71+
options: {
72+
spawn: false,
73+
}
74+
},
75+
assets:{
76+
files: ['app/assets/**/*', '!app/assets/sass/**'],
77+
tasks: ['copy:assets'],
78+
options: {
79+
spawn: false,
80+
}
81+
}
82+
},
83+
84+
// nodemon watches for changes and restarts app
85+
nodemon: {
86+
dev: {
87+
script: 'server.js',
88+
options: {
89+
ext: 'js',
90+
ignore: ['node_modules/**', 'app/assets/**', 'public/**'],
91+
args: grunt.option.flags()
92+
}
93+
}
94+
},
95+
96+
concurrent: {
97+
target: {
98+
tasks: ['watch', 'nodemon'],
99+
options: {
100+
logConcurrentOutput: true
101+
}
102+
}
103+
}
104+
});
105+
106+
[
107+
'grunt-contrib-copy',
108+
'grunt-contrib-watch',
109+
'grunt-contrib-clean',
110+
'grunt-sass',
111+
'grunt-nodemon',
112+
'grunt-text-replace',
113+
'grunt-concurrent'
114+
].forEach(function (task) {
115+
grunt.loadNpmTasks(task);
116+
});
117+
118+
grunt.registerTask(
119+
'convert_template',
120+
'Converts the govuk_template to use mustache inheritance',
121+
function () {
122+
var script = require(__dirname + '/lib/template-conversion.js');
123+
124+
script.convert();
125+
grunt.log.writeln('govuk_template converted');
126+
}
127+
);
128+
129+
grunt.registerTask('generate-assets', [
130+
'clean',
131+
'copy',
132+
'convert_template',
133+
'replace',
134+
'sass'
135+
]);
136+
137+
grunt.registerTask('default', [
138+
'generate-assets',
139+
'concurrent:target'
140+
]);
141+
142+
grunt.event.on('watch', function(action, filepath, target) {
143+
144+
// just copy the asset that was changed, not all of them
145+
146+
if (target == "assets"){
147+
grunt.config('copy.assets.files.0.src', filepath.replace("app/assets/",""));
148+
}
149+
150+
});
151+
152+
};

LICENCE.txt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (C) 2014 HM Government (Government Digital Service)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7+
of the Software, and to permit persons to whom the Software is furnished to do
8+
so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: node ./node_modules/grunt-cli/bin/grunt --gruntfile Gruntfile.js generate-assets && node server.js

README.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# GOV.UK Prototyping Kit
2+
3+
The kit provides a simple way to make interactive prototypes that look like pages on GOV.UK. These prototypes can be used to show ideas to people you work with, and to do user research.
4+
5+
It's built on the [Express](http://expressjs.com/) framework, and uses these GOV.UK resources:
6+
7+
- [GOV.UK template](https://github.com/alphagov/govuk_template)
8+
- [GOV.UK front end toolkit](https://github.com/alphagov/govuk_frontend_toolkit)
9+
- [GOV.UK elements](https://github.com/alphagov/govuk_elements)
10+
11+
Read the [project principles](docs/principles.md).
12+
13+
## Requirements
14+
15+
#### [Node](http://nodejs.org/)
16+
17+
You may already have it, try:
18+
19+
```
20+
node --version
21+
```
22+
23+
Your version should be 4.2.2.
24+
25+
If you don't have Node, download it here: [http://nodejs.org/](http://nodejs.org/).
26+
27+
## Getting started
28+
29+
Install Node.js (see requirements)
30+
31+
#### Download the prototype kit
32+
33+
[Download the zip file](https://github.com/alphagov/govuk_prototype_kit/archive/master.zip)
34+
35+
Unzip the file
36+
37+
#### Install dependencies
38+
39+
Open a command line app (Terminal on OSX) and change to the unzipped directory. Then run:
40+
41+
```
42+
npm install
43+
```
44+
45+
This will install extra code that the prototype kit needs.
46+
47+
#### Run the app
48+
49+
```
50+
node start.js
51+
```
52+
53+
Go to [localhost:3000](http://localhost:3000) in your browser.
54+
55+
If you want to view multiple prototypes at the same time you can give them unique port numbers, like this:
56+
57+
```
58+
PORT=3005 node start.js
59+
```
60+
61+
To avoid conflicts we recommend using ports between 3000 and 3009. To change the port number permanently, edit the port variable in /server.js.
62+
63+
#### Hot reload
64+
65+
Any code changes should update in the browser without you restarting the app.
66+
67+
The app recompiles app/assets/stylesheets/application.scss everytime changes are observed.
68+
69+
## Documentation
70+
71+
- [Prototyping kit principles](docs/principles.md)
72+
- [Getting started](docs/getting-started.md)
73+
- [Making pages](docs/making-pages.md)
74+
- [Writing CSS](docs/writing-css.md)
75+
- [Deploying (getting your work online)](docs/deploying.md)
76+
- [Updating the kit to the latest version](docs/updating-the-kit.md)
77+
- [Tips and tricks](docs/tips-and-tricks.md)
78+
- [Creating routes (server-side programming)](docs/creating-routes.md)
79+
80+
This project is built on top of Express, the idea is that it is straightforward to create simple static pages out of the box. However, you're not limited to that - more dynamic sites can be built with more understanding of Express. Here's a good [Express tutorial.](http://code.tutsplus.com/tutorials/introduction-to-express--net-33367)
81+
82+
## Community
83+
84+
We have two Slack channels for this app. You'll need a government email address to join them.
85+
86+
* [Slack channel for users of the Prototype Kit](https://ukgovernmentdigital.slack.com/messages/prototype-kit/)
87+
* [Slack channel for developers of the Prototype Kit](https://ukgovernmentdigital.slack.com/messages/prototype-kit-dev/)

VERSION.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0

app/assets/images/favicon.ico

16.9 KB
Binary file not shown.

app/assets/images/separator-2x.png

201 Bytes
Loading

app/assets/images/separator.png

145 Bytes
Loading

0 commit comments

Comments
 (0)