diff --git a/.drone.yml b/.drone.yml index 99d348c826..ea543054e8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,7 +7,7 @@ clone: steps: - name: build - image: livingdocs/docker-node:20.10 + image: livingdocs/docker-node:28-22 volumes: - name: dockersocket path: /var/run/docker.sock @@ -20,7 +20,7 @@ steps: from_secret: DOCKER_PASSWORD - name: release - image: livingdocs/semantic-release:v2.1.1 + image: livingdocs/semantic-release:v3.0.3 environment: GH_TOKEN: from_secret: GH_TOKEN @@ -39,7 +39,7 @@ name: tag steps: - name: tag - image: livingdocs/docker-node:20.10 + image: livingdocs/docker-node:28-22 environment: DOCKER_USERNAME: from_secret: DOCKER_USERNAME @@ -57,6 +57,6 @@ trigger: --- kind: signature -hmac: 0231cb8f4527ace551e9aba128384e49eb769c91c6521f6f4e3073b828398eec +hmac: 14b59a09279d47928fb83dedfe6de5ace7e75f64e14ad53f5e9bbe0e8ce53640 ... diff --git a/Dockerfile b/Dockerfile index 0c11c5311a..0eb74674d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM livingdocs/node:18 as builder +FROM livingdocs/node:26 as builder ADD package*.json /app/ WORKDIR /app RUN apk add --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community hugo && npm ci diff --git a/Taxonomy.md b/Taxonomy.md deleted file mode 100644 index ca91dabb56..0000000000 --- a/Taxonomy.md +++ /dev/null @@ -1,25 +0,0 @@ -# Taxonomy - -## Features - -- custom-server-feature -- document-copy -- notifications -- tasks -- soft-lock -- ... - -## Project Config Properties - -See list form server - -- contentType -- component -- settings -- ... - -## APIs - -- public-api -- server-hooks -- webhooks diff --git a/bin/add-menu.js b/bin/add-menu.js index 75492296d4..56dd6d1e9f 100644 --- a/bin/add-menu.js +++ b/bin/add-menu.js @@ -1,7 +1,8 @@ #!/usr/bin/env node -'use strict' -const fs = require('fs') -const files = require('glob').sync('**/*.md', { +import fs from 'fs' +import {globSync} from 'glob' + +const files = globSync('**/*.md', { nodir: true, absolute: true }) diff --git a/bin/build-index.js b/bin/build-index.js index 9db5c8f8db..21be34e2a3 100755 --- a/bin/build-index.js +++ b/bin/build-index.js @@ -1,7 +1,7 @@ -const fs = require('fs') -const {Parser} = require('htmlparser2') -const {DomHandler} = require('domhandler') -const {getText, hasAttrib, getAttributeValue, textContent} = require('domutils') +import fs from 'fs' +import {Parser} from 'htmlparser2' +import {DomHandler} from 'domhandler' +import {getText, hasAttrib, getAttributeValue, textContent} from 'domutils' buildIndex('./public/search.json') diff --git a/bin/compress.js b/bin/compress.js index 955197bce7..97c295eaa9 100644 --- a/bin/compress.js +++ b/bin/compress.js @@ -1,7 +1,7 @@ -const fs = require('fs') -const glob = require('glob') -const zlib = require('zlib') -const pipe = require('util').promisify(require('stream').pipeline) +import fs from 'fs' +import {globSync} from 'glob' +import zlib from 'zlib' +import {pipeline} from 'stream/promises' const isCompressed = /\.(gz|br)$/ @@ -9,7 +9,7 @@ function doGzip(file) { if (isCompressed.test(file)) return const source = fs.createReadStream(file) const destination = fs.createWriteStream(`${file}.gz`) - return pipe( + return pipeline( source, zlib.createGzip({ level: 9 @@ -22,7 +22,7 @@ function doBrotli(file) { if (isCompressed.test(file)) return const source = fs.createReadStream(file) const destination = fs.createWriteStream(`${file}.br`) - return pipe( + return pipeline( source, zlib.createBrotliCompress({ params: { @@ -34,7 +34,7 @@ function doBrotli(file) { ) } -const files = glob.sync('./public/**/*', {nodir: true, absolute: true}) +const files = globSync('./public/**/*', {nodir: true, absolute: true}) console.log(`Run compression on ${files.length} files`) Promise.all([Promise.all(files.map(doGzip)), Promise.all(files.map(doBrotli))]).then(() => console.log(`Compressed`) diff --git a/bin/download-images.js b/bin/download-images.js index b7c7d114f7..0393ac9ad5 100644 --- a/bin/download-images.js +++ b/bin/download-images.js @@ -1,9 +1,8 @@ -'use strict' -const glob = require('glob') -const fs = require('fs/promises') -const fsSync = require('fs') -const path = require('path') -const https = require('https') +import {globSync} from 'glob' +import fs from 'fs/promises' +import fsSync from 'fs' +import path from 'path' +import https from 'https' const githubImageRegex = /https:\/\/user-images\.githubusercontent\.com\/[^"\)\s]+/g @@ -19,7 +18,7 @@ async function downloadImage(url, outputPath) { } async function processFiles() { - const files = glob.sync('content/**/*.md', {cwd: path.resolve(__dirname, '../')}) + const files = globSync('content/**/*.md', {cwd: path.resolve(import.meta.dirname, '../')}) for (const file of files) { const content = await fs.readFile(file, 'utf-8') diff --git a/bin/generate-release-changes.js b/bin/generate-release-changes.js index bd7ff436b5..a388de3cb9 100755 --- a/bin/generate-release-changes.js +++ b/bin/generate-release-changes.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const fs = require('fs') -const {parseArgs} = require('util') +import fs from 'fs' +import {parseArgs} from 'util' const MAX_RETRIES = 5 const RETRY_DELAY = 1000 diff --git a/bin/generate-unified-docs.js b/bin/generate-unified-docs.js index 566aa4ad03..874f416a67 100755 --- a/bin/generate-unified-docs.js +++ b/bin/generate-unified-docs.js @@ -1,7 +1,7 @@ #!/usr/bin/env node -const fs = require('fs') -const path = require('path') +import fs from 'fs' +import path from 'path' /** * Script to generate a unified documentation file from all markdown files used for AI input via MCP diff --git a/content/_content.gotmpl b/content/_content.gotmpl index a12c30460d..256973aa85 100644 --- a/content/_content.gotmpl +++ b/content/_content.gotmpl @@ -29,13 +29,13 @@ Generate redirects within hugo using the nginx redirect map Expose releases.json for https://downstreams.cluster.livingdocs.io/ {{ $.AddResource ( dict - "content" (dict "mediaType" "application/json" "value" ($.Site.Data.releases | jsonify)) + "content" (dict "mediaType" "application/json" "value" (hugo.Data.releases | jsonify)) "path" "releases.json" ) }} {{ $versions := partialCached "_api-versions" $ true }} -{{ if eq $.Site.BuildDrafts false }}{{ $versions = where $versions "upcoming" "eq" false }}{{ end }} +{{ if hugo.IsProduction }}{{ $versions = where $versions "upcoming" "eq" false }}{{ end }} {{ hugo.Store.Set "api-versions" $versions }} {{ $endpoints := partialCached "_api-endpoints" $ true }} diff --git a/content/reference/public-api/_content.gotmpl b/content/reference/public-api/_content.gotmpl index b98f5b8d16..3a8954be82 100644 --- a/content/reference/public-api/_content.gotmpl +++ b/content/reference/public-api/_content.gotmpl @@ -1,10 +1,10 @@ {{ $endpoints := partialCached "_api-endpoints" $ true }} {{ $sectionsStat := os.Stat "data/sections.yaml" }} -{{ range $section := $.Site.Data.sections }} +{{ range $section := hugo.Data.sections }} diff --git a/hugo.yaml b/hugo.yaml index 1c7da0afbd..f0cce2a76c 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -1,4 +1,4 @@ -languageCode: en-us +locale: en-us theme: hugo-docs uglyURLs: false refLinksErrorLevel: ERROR diff --git a/package-lock.json b/package-lock.json index 6b12c61444..7de0cb7eeb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,12 +10,12 @@ "license": "ISC", "dependencies": { "clipboard": "^2.0.11", - "domhandler": "^5.0.3", - "domutils": "^3.2.2", - "glob": "^13.0.0", - "htmlparser2": "^10.0.0", + "domhandler": "^6.0.1", + "domutils": "^4.0.2", + "glob": "^13.0.6", + "htmlparser2": "^12.0.0", "lunr": "^2.3.9", - "serve": "^14.2.4" + "serve": "^14.2.6" }, "devDependencies": { "prettier": "3.9.4", @@ -408,57 +408,69 @@ "license": "MIT" }, "node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-3.1.1.tgz", + "integrity": "sha512-4MEa38/QexBob6gFNwu+EGdWvhJ1OKuNwdYY3Y3NyeWDQfnGeDYQUDfIRzWu5B5gsv03so2Uxd28YC6zrsx3Lw==", "license": "MIT", "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" + "domelementtype": "^3.0.0", + "domhandler": "^6.0.0", + "entities": "^8.0.0" + }, + "engines": { + "node": ">=20.19.0" }, "funding": { + "type": "github", "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" } }, "node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-3.0.0.tgz", + "integrity": "sha512-umCQid3jKbDmVjx8jGaW7uUykm4DEUeyV21hPxNMo2nV955DhUThwqyOIDtreepP31hl84X7G5U9ZfsWvIB3Pg==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/fb55" } ], - "license": "BSD-2-Clause" + "license": "BSD-2-Clause", + "engines": { + "node": ">=20.19.0" + } }, "node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-6.0.1.tgz", + "integrity": "sha512-gYzvtM72ZtxQO0T048kd6HWSbbGCNOUwcnfQ01cqIJ4X2IYKFFHZ5mKvrQETcFXxsRObZulDaKmy//R7TPtsBg==", "license": "BSD-2-Clause", "dependencies": { - "domelementtype": "^2.3.0" + "domelementtype": "^3.0.0" }, "engines": { - "node": ">= 4" + "node": ">=20.19.0" }, "funding": { + "type": "github", "url": "https://github.com/fb55/domhandler?sponsor=1" } }, "node_modules/domutils": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", - "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-4.0.2.tgz", + "integrity": "sha512-qI4JLRKnSzqFqr7hAlS5xQDusBCjKSEG4t4+7aNrIQMHBcsC2TGEhuyABJdYkgSewL57PNLYEiibY2iPKhKpaA==", "license": "BSD-2-Clause", "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" + "dom-serializer": "^3.0.0", + "domelementtype": "^3.0.0", + "domhandler": "^6.0.0" + }, + "engines": { + "node": ">=20.19.0" }, "funding": { + "type": "github", "url": "https://github.com/fb55/domutils?sponsor=1" } }, @@ -475,12 +487,12 @@ "license": "MIT" }, "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-8.0.0.tgz", + "integrity": "sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==", "license": "BSD-2-Clause", "engines": { - "node": ">=0.12" + "node": ">=20.19.0" }, "funding": { "url": "https://github.com/fb55/entities?sponsor=1" @@ -579,9 +591,9 @@ } }, "node_modules/htmlparser2": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.1.0.tgz", - "integrity": "sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-12.0.0.tgz", + "integrity": "sha512-Tz7u1i95/g2x2jz81+x0FBVhBhY5aRTvD3tXXdFaljuNdzDLJ8UGNRrTcj2cgQvAg3iW/h77Fz15nLW0L0CrZw==", "funding": [ "https://github.com/fb55/htmlparser2?sponsor=1", { @@ -591,22 +603,13 @@ ], "license": "MIT", "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.2.2", - "entities": "^7.0.1" - } - }, - "node_modules/htmlparser2/node_modules/entities": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", - "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" + "domelementtype": "^3.0.0", + "domhandler": "^6.0.0", + "domutils": "^4.0.2", + "entities": "^8.0.0" }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" + "engines": { + "node": ">=20.19.0" } }, "node_modules/human-signals": { diff --git a/package.json b/package.json index 45f2c67c4a..b1bc4573df 100644 --- a/package.json +++ b/package.json @@ -2,15 +2,16 @@ "name": "livingdocs", "version": "1.0.0", "description": "", + "type": "module", "main": "index.js", "dependencies": { "clipboard": "^2.0.11", - "domhandler": "^5.0.3", - "domutils": "^3.2.2", - "glob": "^13.0.0", - "htmlparser2": "^10.0.0", + "domhandler": "^6.0.1", + "domutils": "^4.0.2", + "glob": "^13.0.6", + "htmlparser2": "^12.0.0", "lunr": "^2.3.9", - "serve": "^14.2.4" + "serve": "^14.2.6" }, "scripts": { "build": "./bin/build.sh", diff --git a/themes/hugo-docs/assets/script.js b/themes/hugo-docs/assets/script.js index 349b113c5e..47c3bacd7f 100644 --- a/themes/hugo-docs/assets/script.js +++ b/themes/hugo-docs/assets/script.js @@ -1,5 +1,4 @@ -'use strict' -const Clipboard = require('clipboard') +import Clipboard from 'clipboard' import * as params from '@params' // cookies diff --git a/themes/hugo-docs/assets/search.js b/themes/hugo-docs/assets/search.js index 426a6b2013..57d9e7f13a 100644 --- a/themes/hugo-docs/assets/search.js +++ b/themes/hugo-docs/assets/search.js @@ -1,4 +1,4 @@ -const lunr = require('lunr') +import lunr from 'lunr' // Separate on any non-word value so that functions in code blocks will be returned in the results. // A search for "registerInitializedHook" would not find `liServer.registerInitializedHook(async`. diff --git a/themes/hugo-docs/layouts/index.searchindex.json b/themes/hugo-docs/layouts/index.searchindex.json index 966c5a7edc..d0090e1ae9 100644 --- a/themes/hugo-docs/layouts/index.searchindex.json +++ b/themes/hugo-docs/layouts/index.searchindex.json @@ -1,4 +1,4 @@ -{{- $pages := .Site.AllPages -}} +{{- $pages := .Site.Pages -}} {{- $pages = where $pages "Params.hidden" "!=" true -}} {{- $pages = where $pages "Params.excludeFromSearch" "!=" true -}} [ diff --git a/themes/hugo-docs/layouts/partials/_api-endpoints.html b/themes/hugo-docs/layouts/partials/_api-endpoints.html index d8edbf2d9a..7c23295304 100644 --- a/themes/hugo-docs/layouts/partials/_api-endpoints.html +++ b/themes/hugo-docs/layouts/partials/_api-endpoints.html @@ -5,12 +5,12 @@ {{ $upcoming = $upcoming | append .version }} {{ end }} -{{ range $key, $value := $.Site.Data.endpoints }} +{{ range $key, $value := hugo.Data.endpoints }} {{ if not $value.apiVersionConstraints }} {{ $value = merge $value (dict "apiVersionConstraints" (dict "neq" "beta")) }} {{ end }} - {{ if not $.Site.BuildDrafts }} + {{ if hugo.IsProduction }} {{ $constraint := $value.apiVersionConstraints }} {{ if and $constraint.eq (in $upcoming $constraint.eq) }}{{ continue }}{{ end }} {{ if and $constraint.gt (in $upcoming $constraint.gt) }}{{ continue }}{{ end }} diff --git a/themes/hugo-docs/layouts/partials/_api-versions.html b/themes/hugo-docs/layouts/partials/_api-versions.html index f7c29fdc9f..308dadd844 100644 --- a/themes/hugo-docs/layouts/partials/_api-versions.html +++ b/themes/hugo-docs/layouts/partials/_api-versions.html @@ -3,7 +3,7 @@ {{ $versions = $versions | append (dict "release" "release-2025-01" "version" "v1" "sequence" 1 "upcoming" false) }} {{ $versions = $versions | append (dict "release" "release-2025-01" "version" "beta" "sequence" 2 "upcoming" false) }} -{{ range (sort .Site.Data.releases "key" "desc") }} +{{ range (sort hugo.Data.releases "key" "desc") }} {{ $version := slicestr .key 8 }} {{ $sequence := partial "api-version-sequence" $version }} {{ if lt $sequence $minimumVersion }}{{ continue }}{{ end }} diff --git a/themes/hugo-docs/layouts/partials/openapi-template.gotmpl b/themes/hugo-docs/layouts/partials/openapi-template.gotmpl index 1f6814f93a..a3bea5aaf9 100644 --- a/themes/hugo-docs/layouts/partials/openapi-template.gotmpl +++ b/themes/hugo-docs/layouts/partials/openapi-template.gotmpl @@ -18,6 +18,6 @@ {{ end }} {{- end -}} -{{ $openapi := merge $.Site.Data.openapi (dict "paths" $openapiPaths) }} +{{ $openapi := merge hugo.Data.openapi (dict "paths" $openapiPaths) }} {{ $openapi = merge $openapi (dict "info" (merge $openapi.info (dict "version" $version))) }} {{ return ($openapi | jsonify (dict "indent" " ")) }} diff --git a/themes/hugo-docs/layouts/shortcodes/release-notes-overview.html b/themes/hugo-docs/layouts/shortcodes/release-notes-overview.html index a502a9074a..491079f32f 100644 --- a/themes/hugo-docs/layouts/shortcodes/release-notes-overview.html +++ b/themes/hugo-docs/layouts/shortcodes/release-notes-overview.html @@ -12,7 +12,7 @@
{{ $page := .Site.Home }} - {{ range sort $.Site.Data.releases "sortId" "desc" }} + {{ range sort hugo.Data.releases "sortId" "desc" }}