Skip to content
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

Release 13.0.0 #1783

Merged
merged 630 commits into from
Nov 21, 2022
Merged

Release 13.0.0 #1783

merged 630 commits into from
Nov 21, 2022

Conversation

lfdebrux
Copy link
Member

@lfdebrux lfdebrux commented Nov 17, 2022

In this release we’ve made some significant changes to how the GOV.UK Prototype Kit works.

These changes make the kit:

  • more secure
  • easier to use
  • easier to update in the future

If you have an existing prototype and want to make the changes in this release, we recommend using the migration script to help with any breaking changes.

Migrate an existing prototype to version 13

If you need help with the Prototype Kit, contact the GOV.UK Prototype team.

Breaking changes

The Prototype Kit is now an npm package

The 2 biggest breaking changes to the Prototype Kit are you can now create a prototype:

  • without downloading a zip file
  • by using an npm command in the terminal

To run the kit, use npm run dev (not npm start).

To make the kit easier to update in the future, we have moved essential Prototype Kit files out of the users prototype folder and into the npm package.

This is alongside other work we've been doing that allows users to delete files they're not using.

Using Node.js

The Prototype Kit no longer supports versions 12 or 14 of Node.js. We recommend you update to the latest LTS version Node.js 18

Creating routes, filters, templates and layouts

How you create routes, filters and templates has changed. There is also a new approach to layouts.

Create routes

Create pages from templates

How to use layouts

Default user template

The default user template for a new prototype has moved to app/views/layouts/main.html.

To help make these changes to an existing prototype, we have a migration script

How to migrate an existing prototype to version 13

Other breaking changes

You can no longer use the Prototype Kit with Internet Explorer 8

The Prototype Kit no longer includes the step by step pattern by default

The Prototype Kit no longer includes jQuery by default

You can no longer use v6 compatibility mode

New features

Manage your Prototype

There is a new Manage your Prototype page in the kit. From this page you can:

GOV.UK Frontend

When creating a new prototype, you will always have the latest version of GOV.UK Frontend.

The latest version of GOV.UK Frontend is version 4.4.0.

Read the release notes

Other changes

  • Guidance and documentation for the Prototype Kit is now at prototype-kit.service.gov.uk

  • There are 2 sets of guidance to support users:

    • Using version 13: prototype-kit.service.gov.uk/docs/
    • Using version 12 or before: prototype-kit.service.gov.uk/v12/docs/
  • You can no longer see the docs folder in your prototype

If you need help with the Prototype Kit, contact the GOV.UK Prototype team.

lfdebrux and others added 30 commits September 27, 2022 11:57
Ensure that create script installs same version of starter files and kit
Use spawn instead of exec so we can inherit stdio.
Make sure first line is separated from second by a newline character.
On Windows (in GitHub Actions test environment) the `create` script
failed because the spawn raised ENOENT:

        Error: spawn npm ENOENT

Using the shell should fix this.
These scripts are no longer accessible by users as they are buried
within the package, and are therefore no longer useful. This commit
removes them.
Show output from npm install when running create script
Fix formatting of .tmp/sass/_extensions.scss
We don't want to accidentally end up with development code installed in
system Node installation after running tests.
- log test directory
- echo to stderr
- no need to create directory for create script
- run in repo dir instead of test dir
- use remove instead of rmdir to avoid deprecation warnings
- use writeJson to simplify creating tracking config
On Windows if given an absolute path starting with drive `create` would
error with `Path contains invalid characters`.
Stop installing govuk-prototype-kit globally in tests
Previously we forced GitHub Actions and npm to use bash as the shell on
all operating systems, npm defaults to using cmd.exe on Windows [[1]],
GitHub Actions defaults to using PowerShell on Windows [[2]]. This
commit removes the overrides, and also fixes up the npm package scripts
syntax to support cmd.exe.

[1]: https://docs.npmjs.com/cli/v8/using-npm/config#script-shell
[2]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
It is sometimes useful to be able to `exec` a command and have the
output go to the terminal. This commit updates our exec to let us do
that. The `child_process.exec` function does not support this, however
spawn does, and we can emulate exec by using a shell (similar to what
the `execa` package or `child_process` itself does).
Adds a script intended for use with npm scripts in package.json. It
sort of works like `start-server-and-test`, only much simpler: it
creates a prototype in a temporary folder using `mkPrototype`, then runs
a shell command in the temporary folder. By default it runs `npm run
start`, although by supplying a command line argument it can run any
command, which is what makes it more useful than a script that creates
and starts the prototype all within node. It can then be composed with
`start-server-and-test`, without the need to pass the test directory
around.

For instance, for a simple test:

        npx start-server-and-test 'node scripts/create-prototype-and-start' 3000 test:smoke

The npm script `start` will be run in the test directory
($TMPDIR/govuk-prototype-kit-test by default, but can be overridden with
KIT_TEST_DIR), and the test script (`test:smoke` in this case) will be
run in the kit project directory.
@lfdebrux lfdebrux changed the title Release v13 Release 13.0.0 Nov 17, 2022
lfdebrux and others added 13 commits November 17, 2022 16:23
The documentation app is no longer part of this repo, so these internal
docs are out-of-place. Delete them.
In future we will be releasing the GOV.UK Prototype Kit as a package on
npm, this commit updates our internal docs to explain how to do that.
Remove #1648 from changelog we backed out those changes in #1658.
Update domain from heroku to service.gov.uk
…hen-migration-is-successful

Provide support contact even when migration is successful
@lfdebrux lfdebrux marked this pull request as ready for review November 21, 2022 11:46
@lfdebrux lfdebrux requested a review from a team as a code owner November 21, 2022 11:46
@lfdebrux lfdebrux merged commit d83e8a6 into main Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants