From a6ae46904297c99c4d803f3aa9146a4da059cd13 Mon Sep 17 00:00:00 2001 From: Nick Colley Date: Wed, 15 Apr 2026 09:51:16 +0100 Subject: [PATCH 1/3] Update Ruby to 3.4.9 and govuk_tech_docs gem to 6.1.0 --- .github/workflows/test.yaml | 2 +- .ruby-version | 2 +- Gemfile | 2 +- Gemfile.lock | 252 ++++++++++++++++++++++++------------ 4 files changed, 169 insertions(+), 89 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c981ee1a..6489c188 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,7 +21,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: '3.1' + ruby-version: '3.4.9' - name: Install dependencies run: npm install diff --git a/.ruby-version b/.ruby-version index 711ee4f5..e0940d40 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.3 \ No newline at end of file +3.4.9 \ No newline at end of file diff --git a/Gemfile b/Gemfile index 6032faec..d57c6803 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ gem "tzinfo-data", platforms: %i[mswin mingw jruby] gem "logger" # Include the tech docs gem -gem "govuk_tech_docs" +gem "govuk_tech_docs", "~> 6.1.0" # Development gem "json" diff --git a/Gemfile.lock b/Gemfile.lock index 059e6fb8..de706818 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,26 +1,39 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.0.8.7) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (8.1.3) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + json + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) ast (2.4.3) autoprefixer-rails (10.4.21.0) execjs (~> 2) - backports (3.25.2) base64 (0.3.0) - bigdecimal (3.2.3) + bigdecimal (4.1.1) chronic (0.10.2) chunky_png (1.4.0) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) - commonmarker (0.23.12) + commonmarker (2.8.1-aarch64-linux) + commonmarker (2.8.1-aarch64-linux-musl) + commonmarker (2.8.1-arm-linux) + commonmarker (2.8.1-arm64-darwin) + commonmarker (2.8.1-x86_64-darwin) + commonmarker (2.8.1-x86_64-linux) + commonmarker (2.8.1-x86_64-linux-musl) compass (1.0.3) chunky_png (~> 1.2) compass-core (~> 1.0.2) @@ -34,27 +47,50 @@ GEM compass-import-once (1.0.5) sass (>= 3.2, < 3.5) concurrent-ruby (1.3.4) - contracts (0.16.1) + connection_pool (3.0.2) + contracts (0.17.3) csv (3.3.5) diff-lcs (1.6.2) - dotenv (3.1.8) + dotenv (3.2.0) + drb (2.2.3) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) - erubis (2.7.0) + erubi (1.13.1) eventmachine (1.2.7) - execjs (2.10.0) + execjs (2.10.1) fast_blank (1.0.1) - fastimage (2.4.0) - ffi (1.17.2-arm64-darwin) - ffi (1.17.2-x86_64-linux-gnu) - google-protobuf (4.32.1-arm64-darwin) + fastimage (2.4.1) + ffi (1.17.4-aarch64-linux-gnu) + ffi (1.17.4-aarch64-linux-musl) + ffi (1.17.4-arm-linux-gnu) + ffi (1.17.4-arm-linux-musl) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86_64-darwin) + ffi (1.17.4-x86_64-linux-gnu) + ffi (1.17.4-x86_64-linux-musl) + google-protobuf (4.34.1) + bigdecimal + rake (~> 13.3) + google-protobuf (4.34.1-aarch64-linux-gnu) + bigdecimal + rake (~> 13.3) + google-protobuf (4.34.1-aarch64-linux-musl) + bigdecimal + rake (~> 13.3) + google-protobuf (4.34.1-arm64-darwin) + bigdecimal + rake (~> 13.3) + google-protobuf (4.34.1-x86_64-darwin) bigdecimal - rake (>= 13) - google-protobuf (4.32.1-x86_64-linux-gnu) + rake (~> 13.3) + google-protobuf (4.34.1-x86_64-linux-gnu) bigdecimal - rake (>= 13) - govuk_tech_docs (5.1.1) + rake (~> 13.3) + google-protobuf (4.34.1-x86_64-linux-musl) + bigdecimal + rake (~> 13.3) + govuk_tech_docs (6.1.0) autoprefixer-rails (~> 10.2) base64 bigdecimal @@ -62,7 +98,7 @@ GEM concurrent-ruby (= 1.3.4) csv haml (~> 6.0) - middleman (= 4.5.1) + middleman (~> 4.6.1) middleman-autoprefixer (~> 2.10) middleman-compass (~> 4.0) middleman-livereload @@ -71,73 +107,76 @@ GEM middleman-syntax (~> 3.6) mutex_m nokogiri - openapi3_parser (~> 0.9.0) + openapi3_parser (~> 0.10.1) redcarpet (~> 3.6) sassc-embedded (~> 1.78.0) + schmooze (~> 0.2.0) terser (~> 1.2.3) - haml (6.3.0) + haml (6.4.0) temple (>= 0.8.2) thor tilt hamster (3.0.0) concurrent-ruby (~> 1.0) - hashie (3.6.0) - http_parser.rb (0.8.0) - i18n (1.6.0) + hashie (5.1.0) + logger + http_parser.rb (0.8.1) + i18n (1.14.8) concurrent-ruby (~> 1.0) - json (2.18.0) - kramdown (2.5.1) - rexml (>= 3.3.9) + json (2.19.3) + kramdown (2.5.2) + rexml (>= 3.4.4) language_server-protocol (3.17.0.5) lint_roller (1.1.0) - listen (3.9.0) + listen (3.10.0) + logger rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) memoist (0.16.2) - middleman (4.5.1) - coffee-script (~> 2.2) - haml (>= 4.0.5) - kramdown (>= 2.3.0) - middleman-cli (= 4.5.1) - middleman-core (= 4.5.1) + middleman (4.6.3) + middleman-cli (= 4.6.3) + middleman-core (= 4.6.3) middleman-autoprefixer (2.10.0) autoprefixer-rails (>= 9.1.4) middleman-core (>= 3.3.3) - middleman-cli (4.5.1) - thor (>= 0.17.0, < 1.3.0) + middleman-cli (4.6.3) + thor (>= 0.17.0, < 2) middleman-compass (4.0.1) compass (>= 1.0.0, < 2.0.0) middleman-core (>= 4.0.0) - middleman-core (4.5.1) - activesupport (>= 6.1, < 7.1) + middleman-core (4.6.3) + activesupport (>= 6.1) addressable (~> 2.4) - backports (~> 3.6) - bundler (~> 2.0) - contracts (~> 0.13, < 0.17) + bundler (> 2.0) + coffee-script (~> 2.2) + contracts dotenv - erubis + erubi execjs (~> 2.0) fast_blank fastimage (~> 2.0) + haml (>= 4.0.5, < 7) hamster (~> 3.0) - hashie (~> 3.4) - i18n (~> 1.6.0) + hashie (>= 3.4, < 6.0) + i18n (>= 1.6, < 1.15) + kramdown (~> 2.4) listen (~> 3.0) memoist (~> 0.14) - padrino-helpers (~> 0.15.0) + padrino-helpers (>= 0.15, < 0.17) parallel - rack (>= 1.4.5, < 3) + rack (>= 3) + rackup sassc (~> 2.0) servolux - tilt (~> 2.0.9) + tilt (~> 2.2) toml - uglifier (~> 3.0) + uglifier (>= 3, < 5) webrick - middleman-livereload (3.4.7) + middleman-livereload (3.5.0) em-websocket (~> 0.5.1) middleman-core (>= 3.3) - rack-livereload (~> 0.3.15) + rack-livereload (~> 0.6.1) middleman-search-gds (0.11.2) execjs (~> 2.6) middleman-core (>= 3.2) @@ -148,39 +187,55 @@ GEM middleman-syntax (3.6.1) middleman-core (>= 3.2) rouge (~> 3.2) - minitest (5.25.5) - multi_json (1.17.0) + minitest (6.0.4) + drb (~> 2.0) + prism (~> 1.5) + multi_json (1.20.1) mutex_m (0.3.0) - nokogiri (1.18.10-arm64-darwin) + nokogiri (1.19.2-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.19.2-aarch64-linux-musl) racc (~> 1.4) - nokogiri (1.18.10-x86_64-linux-gnu) + nokogiri (1.19.2-arm-linux-gnu) racc (~> 1.4) - openapi3_parser (0.9.2) - commonmarker (~> 0.17) + nokogiri (1.19.2-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.19.2-arm64-darwin) + racc (~> 1.4) + nokogiri (1.19.2-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.19.2-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.19.2-x86_64-linux-musl) + racc (~> 1.4) + openapi3_parser (0.10.1) + commonmarker (>= 1.0) ostruct (0.6.3) - padrino-helpers (0.15.3) + padrino-helpers (0.16.1) i18n (>= 0.6.7, < 2) - padrino-support (= 0.15.3) - tilt (>= 1.4.1, < 3) - padrino-support (0.15.3) - parallel (1.27.0) - parser (3.3.9.0) + padrino-support (= 0.16.1) + tilt (>= 2.1, < 3) + padrino-support (0.16.1) + parallel (1.28.0) + parser (3.3.11.1) ast (~> 2.4.1) racc parslet (2.0.0) - prism (1.5.1) - public_suffix (6.0.2) + prism (1.9.0) + public_suffix (7.0.5) racc (1.8.1) - rack (2.2.20) - rack-livereload (0.3.17) - rack + rack (3.1.21) + rack-livereload (0.6.1) + rack (>= 3.0, < 3.2) + rackup (2.3.1) + rack (>= 3) rainbow (3.1.1) - rake (13.3.1) + rake (13.4.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) redcarpet (3.6.1) - regexp_parser (2.11.3) + regexp_parser (2.12.0) rexml (3.4.4) rouge (3.30.0) rspec (3.13.2) @@ -192,10 +247,10 @@ GEM rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.7) + rspec-mocks (3.13.8) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.6) + rspec-support (3.13.7) rubocop (1.79.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) @@ -234,42 +289,67 @@ GEM rubocop (~> 1.72, >= 1.72.1) ruby-progressbar (1.13.0) sass (3.4.25) - sass-embedded (1.93.2) + sass-embedded (1.99.0-aarch64-linux-gnu) + google-protobuf (~> 4.31) + sass-embedded (1.99.0-aarch64-linux-musl) + google-protobuf (~> 4.31) + sass-embedded (1.99.0-arm-linux-gnueabihf) + google-protobuf (~> 4.31) + sass-embedded (1.99.0-arm-linux-musleabihf) + google-protobuf (~> 4.31) + sass-embedded (1.99.0-arm64-darwin) + google-protobuf (~> 4.31) + sass-embedded (1.99.0-x86_64-darwin) + google-protobuf (~> 4.31) + sass-embedded (1.99.0-x86_64-linux-gnu) + google-protobuf (~> 4.31) + sass-embedded (1.99.0-x86_64-linux-musl) google-protobuf (~> 4.31) - rake (>= 13) sassc (2.4.0) ffi (~> 1.9) sassc-embedded (1.78.0) sass-embedded (~> 1.78) + schmooze (0.2.0) + securerandom (0.4.1) servolux (0.13.0) sprockets (4.2.2) concurrent-ruby (~> 1.0) logger rack (>= 2.2.4, < 4) temple (0.10.4) - terser (1.2.6) + terser (1.2.7) execjs (>= 0.3.0, < 3) - thor (1.2.2) - tilt (2.0.11) + thor (1.5.0) + tilt (2.7.0) toml (0.3.0) parslet (>= 1.8.0, < 3.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - uglifier (3.2.0) + uglifier (4.2.1) execjs (>= 0.3.0, < 3) unicode-display_width (3.2.0) unicode-emoji (~> 4.1) - unicode-emoji (4.1.0) - webrick (1.9.1) + unicode-emoji (4.2.0) + uri (1.1.1) + webrick (1.9.2) PLATFORMS - arm64-darwin-21 - arm64-darwin-23 - arm64-darwin-24 + aarch64-linux + aarch64-linux-gnu + aarch64-linux-musl + arm-linux + arm-linux-gnu + arm-linux-gnueabihf + arm-linux-musl + arm-linux-musleabihf + arm64-darwin + x86_64-darwin x86_64-linux + x86_64-linux-gnu + x86_64-linux-musl DEPENDENCIES - govuk_tech_docs + govuk_tech_docs (~> 6.1.0) json logger ostruct @@ -280,4 +360,4 @@ DEPENDENCIES wdm (~> 0.1.0) BUNDLED WITH - 2.2.15 + 2.6.9 From 5fd0de8da4ed8ba062d28527bd48c348339af529 Mon Sep 17 00:00:00 2001 From: Nick Colley Date: Wed, 15 Apr 2026 10:00:31 +0100 Subject: [PATCH 2/3] Remove unneeded override We can now use the `include_child_resources` option --- lib/table_of_contents_helpers.rb | 14 -------------- source/layouts/v4.erb | 2 +- source/layouts/v5.erb | 2 +- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/table_of_contents_helpers.rb b/lib/table_of_contents_helpers.rb index 93765817..ffb59bc1 100644 --- a/lib/table_of_contents_helpers.rb +++ b/lib/table_of_contents_helpers.rb @@ -2,20 +2,6 @@ # Extra helpers for customising the rendering of the table of contents in the sidebar # so it accomodates a separate table of contents for the `v4` section of the site module TableOfContentsHelpers - ## - # Override `render_page_tree` so it can be bypassed when rendering the children - # of a specific given page (stored in `@parent_page`) (see `without_child_pages_for` bellow). - # This enables not rendering the child pages of the `index`, as they'll be rendered - # individually as well. - # This is due to the lack of abstraction for the test checking whether to render a resource - # as a single item or an item the tree of its children - # See: https://github.com/alphagov/tech-docs-gem/blob/207bcb8593197f3aad8983018ca0a91db7783410/lib/govuk_tech_docs/table_of_contents/helpers.rb#L74 - def render_page_tree(resources, *args) - return "" if resources == @parent_page&.children - - super(resources, *args) - end - ## # Temporarily excludes the children of the given page # from being rendered by `render_page_tree` while it runs diff --git a/source/layouts/v4.erb b/source/layouts/v4.erb index 251e70d0..09d4603e 100644 --- a/source/layouts/v4.erb +++ b/source/layouts/v4.erb @@ -17,7 +17,7 @@ wrap_layout :core do with_page_in_navigation(v4_index) do without_child_pages_for(v4_index) do - render_page_tree(resources, current_page, config, html) + render_page_tree(resources, current_page, config, html, include_child_resources: false) end end end diff --git a/source/layouts/v5.erb b/source/layouts/v5.erb index 9e445e5b..6d098d71 100644 --- a/source/layouts/v5.erb +++ b/source/layouts/v5.erb @@ -17,7 +17,7 @@ wrap_layout :core do with_page_in_navigation(v5_index) do without_child_pages_for(v5_index) do - render_page_tree(resources, current_page, config, html) + render_page_tree(resources, current_page, config, html, include_child_resources: false) end end end From 4c5cea4945cb8f92b1c8b20ad3a9914c6413b455 Mon Sep 17 00:00:00 2001 From: Nick Colley Date: Wed, 15 Apr 2026 11:36:09 +0100 Subject: [PATCH 3/3] Skip failing application.js link check When the hyperlink package tries to check the application.js it will parse the code so it can look for additional links to try. When it does this it fails when it encounters optional chaining syntax (`?.`) this is because the parser does not support it yet. This skip can be removed when this support is added and shipped: https://github.com/estools/estraverse/issues/112 See also https://github.com/alphagov/govuk-frontend-docs/pull/577#issuecomment-3714893525 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a4bf06af..0ee322a2 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build:sassdocv5": "sassdoc --no-update-notifier --parse node_modules/govuk-frontend-v5/dist/govuk/ > data/sassdoc-v5.json", "build:sassdocv4": "sassdoc --no-update-notifier --parse node_modules/govuk-frontend-v4/govuk/ > data/sassdoc-v4.json", "lint": "standard", - "check-links": "hyperlink --canonicalroot https://frontend.design-system.service.gov.uk --internal --recursive build/index.html --skip 'property=\"og:image\"' | tee check-links.log | tap-mocha-reporter min" + "check-links": "hyperlink --canonicalroot https://frontend.design-system.service.gov.uk --internal --recursive build/index.html --skip 'property=\"og:image\"' --skip 'application.js' | tee check-links.log | tap-mocha-reporter min" }, "devDependencies": { "govuk-frontend": "^6.1.0",