diff --git a/.github/workflows/deploy-bundle-preview.yml b/.github/workflows/deploy-bundle-preview.yml index d165456c..f5615de5 100644 --- a/.github/workflows/deploy-bundle-preview.yml +++ b/.github/workflows/deploy-bundle-preview.yml @@ -17,14 +17,16 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: - node-version: 21.6.1 + node-version-file: .nvmrc - name: Validate Branch Names + env: + BRANCH_NAME: ${{ github.event.pull_request.head.ref || github.ref_name }} run: | # Check if branch names contain invalid characters. Only alphanumeric, _, -, ., and / are allowed. validate_branch_name() { @@ -34,10 +36,12 @@ jobs: exit 1 fi } - validate_branch_name "${{ github.event.pull_request.head.ref || github.ref_name }}" + validate_branch_name "$BRANCH_NAME" - name: Extract Branch Names id: extract_branch + env: + BRANCH_NAME: ${{ github.event.pull_request.head.ref || github.ref_name }} run: | # Extract and transform branch names extract_branch() { @@ -53,7 +57,7 @@ jobs: } # Transform branch names in form of `refs/heads/main` to `main` - draft_branch=$(extract_branch "${{ github.event.pull_request.head.ref || github.ref_name }}") + draft_branch=$(extract_branch "$BRANCH_NAME") # Replace / with - in the draft branch name to use as a directory name draft_directory=$(echo "$draft_branch" | tr / -) @@ -77,8 +81,8 @@ jobs: if: success() run: | set -o pipefail - gulp lint |& tee $GITHUB_WORKSPACE/build.log - gulp preview:build |& tee $GITHUB_WORKSPACE/build.log + npx gulp lint |& tee $GITHUB_WORKSPACE/build.log + npx gulp preview:build |& tee $GITHUB_WORKSPACE/build.log env: NO_COLOR: 1 @@ -103,7 +107,7 @@ jobs: - name: Create Build Success Comment if: ${{ success() && github.event.pull_request.number }} - uses: peter-evans/create-or-update-comment@v4 + uses: peter-evans/create-or-update-comment@v5 with: issue-number: ${{ github.event.pull_request.number }} body: "${{ env.BUILD_SUCCESS_COMMENT }}" @@ -111,7 +115,7 @@ jobs: - name: Create Build Failure Comment if: ${{ failure() && github.event.pull_request.number }} - uses: peter-evans/create-or-update-comment@v4 + uses: peter-evans/create-or-update-comment@v5 with: issue-number: ${{ github.event.pull_request.number }} body: | @@ -122,7 +126,7 @@ jobs: - name: Find Comment id: fc if: ${{ success() && github.event.pull_request.number }} - uses: peter-evans/find-comment@v3 + uses: peter-evans/find-comment@v4 with: issue-number: ${{ github.event.pull_request.number }} body-includes: UI bundle preview build successful! @@ -191,7 +195,7 @@ jobs: - name: Update Comment if: ${{ steps.fc.outputs.comment-id != '' }} - uses: peter-evans/create-or-update-comment@v4 + uses: peter-evans/create-or-update-comment@v5 with: comment-id: ${{ steps.fc.outputs.comment-id }} body: | @@ -199,7 +203,7 @@ jobs: reactions: hooray - name: Upload Deploy Log - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 if: always() with: name: deploy.log diff --git a/.github/workflows/release-ui-bundle.yml b/.github/workflows/release-ui-bundle.yml index b216fabc..25d08e4a 100644 --- a/.github/workflows/release-ui-bundle.yml +++ b/.github/workflows/release-ui-bundle.yml @@ -19,7 +19,7 @@ jobs: credentials: https://${{ secrets.DOCS_GITHUB_PAT }}@github.com - name: Checkout Repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 # fetch tags too @@ -34,9 +34,9 @@ jobs: - name: Setup Node.js if: ${{ steps.skip_release.outputs.skip_release == '' }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: - node-version: 21.6.1 + node-version-file: .nvmrc - name: Install Dependencies if: ${{ steps.skip_release.outputs.skip_release == '' }} @@ -46,7 +46,7 @@ jobs: if: ${{ steps.skip_release.outputs.skip_release == '' }} run: | set -o pipefail - gulp bundle |& tee $GITHUB_WORKSPACE/build.log + npx gulp bundle |& tee $GITHUB_WORKSPACE/build.log - name: Get Last Release Number id: get_last_release_number diff --git a/.nvmrc b/.nvmrc index 1b497a7b..a45fd52c 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.20.2 \ No newline at end of file +24 diff --git a/README.adoc b/README.adoc index 9e35cb7f..246c3b0e 100644 --- a/README.adoc +++ b/README.adoc @@ -1,6 +1,8 @@ = DataStax Docs UI // Variables: :current-release: +// The major version of Node.js in .nvmrc +:nodejs-version: 24 // Settings: :!example-caption: :experimental: @@ -95,7 +97,7 @@ A more comprehensive tutorial can be found in the documentation at {url-antora-u To preview and bundle the UI, you need the following software on your computer: * {url-git}[git] (command: `git`) -* {url-nodejs}[Node.js] (commands: `node` and `npm`) +* {url-nodejs}[Node.js] {nodejs-version} (commands: `node` and `npm`) * {url-gulp}[Gulp CLI] (command: `gulp`) ==== git @@ -119,30 +121,33 @@ node --version ---- If this command fails with an error, you don't have Node.js installed. -If the command doesn't report an https://nodejs.org/en[LTS version] of Node.js, it means you don't have a suitable version of Node.js installed. +This project uses Node.js {nodejs-version}, which is set in its [.path]_.nvmrc_ file and is also what its GitHub Actions workflows use. +If the command reports a different major version, you don't have a suitable version of Node.js installed. While you can install Node.js from the official packages, we strongly recommend that you use {url-nvm}[nvm] (Node Version Manager) to manage your Node.js installation(s). Follow the {url-nvm-install}[nvm installation instructions] to set up nvm on your machine. -Once you've installed nvm, open a new terminal and install Node.js LTS using the following command: +Once you've installed nvm, open a new terminal and install Node.js {nodejs-version} using the following command: -[source,shell] +[source,shell,subs=attributes+] ---- -nvm install --lts +nvm install {nodejs-version} ---- You can switch to this version of Node.js at any time using the following command: -[source,shell] +[source,shell,subs=attributes+] ---- -nvm use --lts +nvm use {nodejs-version} ---- -To make Node.js LTS the default in new terminals, type: +In the project folder, you can leave out the version (`nvm install` or `nvm use`), and nvm reads it from [.path]_.nvmrc_. -[source,shell] +To make Node.js {nodejs-version} the default in new terminals, type: + +[source,shell,subs=attributes+] ---- -nvm alias default node +nvm alias default {nodejs-version} ---- Now that you have Node.js installed, you can proceed with installing the Gulp CLI. @@ -159,6 +164,9 @@ You can install the Gulp CLI globally (which resolves to a location in your user npm install -g gulp-cli ---- +nvm keeps globally installed packages separate for each version of Node.js. +When you start using another version, such as when this project moves to a newer one, run this command again with that version active, or the `gulp` command fails with `command not found`. + Verify the Gulp CLI is installed and on your PATH by running: [source,shell] @@ -173,7 +181,8 @@ If you prefer to install global packages using Yarn, run this command instead: yarn global add gulp-cli ---- -Alternately, you can use the `gulp` command that is installed by the project's dependencies. +Alternately, you can skip the global install and use the `gulp` command that the project's dependencies provide, which keeps working when you switch versions of Node.js. +Once you've installed the project's dependencies, put `npx` in front of the `gulp` commands in this guide, as in the following command (the GitHub Actions workflows run Gulp this way): [source,shell] ---- diff --git a/gulp.d/tasks/build-preview-pages.js b/gulp.d/tasks/build-preview-pages.js index f62bd942..a3bfa810 100644 --- a/gulp.d/tasks/build-preview-pages.js +++ b/gulp.d/tasks/build-preview-pages.js @@ -14,12 +14,6 @@ const yaml = require('js-yaml') const ASCIIDOC_ATTRIBUTES = { experimental: '', icons: 'font', sectanchors: '', 'source-highlighter': 'highlight.js' } -const algoliaTestKeys = { - algoliaAppId: 'R2IYF7ETH7', - algoliaIndexName: 'docsearch', - algoliaApiKey: '599cec31baffa4868cae4e79f180729b', -} - module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) => Promise.all([ loadSampleUiModel(previewSrc), @@ -43,7 +37,7 @@ module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) => for (const component of baseUiModel.site.components) { for (const version of component.versions || []) version.asciidoc = asciidoc } - baseUiModel = { ...baseUiModel, env: process.env, site: { ...baseUiModel.site, keys: algoliaTestKeys } } + baseUiModel = { ...baseUiModel, env: process.env } delete baseUiModel.asciidoc return [baseUiModel, layouts] }) diff --git a/package-lock.json b/package-lock.json index 70768e86..c9813cba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "@antora/logger": "^3.1.4", "@asciidoctor/core": "~2.2", "@asciidoctor/tabs": "1.0.0-beta.6", - "@docsearch/js": "^3.7.0", + "@docsearch/css": "3.7.0", "@floating-ui/dom": "^1.6.12", "@fontsource-variable/roboto-flex": "~5.0", "@fontsource-variable/sora": "^5.0.15", @@ -72,231 +72,6 @@ "node": ">=0.10.0" } }, - "node_modules/@algolia/autocomplete-core": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.17.6.tgz", - "integrity": "sha512-lkDoW4I7h2kKlIgf3pUt1LqvxyYKkVyiypoGLlUnhPSnCpmeOwudM6rNq6YYsCmdQtnDQoW5lUNNuj6ASg3qeg==", - "dev": true, - "dependencies": { - "@algolia/autocomplete-plugin-algolia-insights": "1.17.6", - "@algolia/autocomplete-shared": "1.17.6" - } - }, - "node_modules/@algolia/autocomplete-plugin-algolia-insights": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.17.6.tgz", - "integrity": "sha512-17NnaacuFzSWVuZu4NKzVeaFIe9Abpw8w+/gjc7xhZFtqj+GadufzodIdchwiB2eM2cDdiR3icW7gbNTB3K2YA==", - "dev": true, - "dependencies": { - "@algolia/autocomplete-shared": "1.17.6" - }, - "peerDependencies": { - "search-insights": ">= 1 < 3" - } - }, - "node_modules/@algolia/autocomplete-preset-algolia": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.17.6.tgz", - "integrity": "sha512-Cvg5JENdSCMuClwhJ1ON1/jSuojaYMiUW2KePm18IkdCzPJj/NXojaOxw58RFtQFpJgfVW8h2E8mEoDtLlMdeA==", - "dev": true, - "dependencies": { - "@algolia/autocomplete-shared": "1.17.6" - }, - "peerDependencies": { - "@algolia/client-search": ">= 4.9.1 < 6", - "algoliasearch": ">= 4.9.1 < 6" - } - }, - "node_modules/@algolia/autocomplete-shared": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.17.6.tgz", - "integrity": "sha512-aq/3V9E00Tw2GC/PqgyPGXtqJUlVc17v4cn1EUhSc+O/4zd04Uwb3UmPm8KDaYQQOrkt1lwvCj2vG2wRE5IKhw==", - "dev": true, - "peerDependencies": { - "@algolia/client-search": ">= 4.9.1 < 6", - "algoliasearch": ">= 4.9.1 < 6" - } - }, - "node_modules/@algolia/client-abtesting": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-abtesting/-/client-abtesting-5.12.0.tgz", - "integrity": "sha512-hx4eVydkm3yrFCFxmcBtSzI/ykt0cZ6sDWch+v3JTgKpD2WtosMJU3Upv1AjQ4B6COSHCOWEX3vfFxW6OoH6aA==", - "dev": true, - "dependencies": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/client-analytics": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-5.12.0.tgz", - "integrity": "sha512-EpTsSv6IW8maCfXCDIptgT7+mQJj7pImEkcNUnxR8yUKAHzTogTXv9yGm2WXOZFVuwstd2i0sImhQ1Vz8RH/hA==", - "dev": true, - "dependencies": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/client-common": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-5.12.0.tgz", - "integrity": "sha512-od3WmO8qxyfNhKc+K3D17tvun3IMs/xMNmxCG9MiElAkYVbPPTRUYMkRneCpmJyQI0hNx2/EA4kZgzVfQjO86Q==", - "dev": true, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/client-insights": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-insights/-/client-insights-5.12.0.tgz", - "integrity": "sha512-8alajmsYUd+7vfX5lpRNdxqv3Xx9clIHLUItyQK0Z6gwGMbVEFe6YYhgDtwslMAP0y6b0WeJEIZJMLgT7VYpRw==", - "dev": true, - "dependencies": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/client-personalization": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-5.12.0.tgz", - "integrity": "sha512-bUV9HtfkTBgpoVhxFrMkmVPG03ZN1Rtn51kiaEtukucdk3ggjR9Qu1YUfRSU2lFgxr9qJc8lTxwfvhjCeJRcqw==", - "dev": true, - "dependencies": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/client-query-suggestions": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-query-suggestions/-/client-query-suggestions-5.12.0.tgz", - "integrity": "sha512-Q5CszzGWfxbIDs9DJ/QJsL7bP6h+lJMg27KxieEnI9KGCu0Jt5iFA3GkREkgRZxRdzlHbZKkrIzhtHVbSHw/rg==", - "dev": true, - "dependencies": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/client-search": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-5.12.0.tgz", - "integrity": "sha512-R3qzEytgVLHOGNri+bpta6NtTt7YtkvUe/QBcAmMDjW4Jk1P0eBYIPfvnzIPbINRsLxIq9fZs9uAYBgsrts4Zg==", - "dev": true, - "dependencies": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/ingestion": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@algolia/ingestion/-/ingestion-1.12.0.tgz", - "integrity": "sha512-zpHo6qhR22tL8FsdSI4DvEraPDi/019HmMrCFB/TUX98yzh5ooAU7sNW0qPL1I7+S++VbBmNzJOEU9VI8tEC8A==", - "dev": true, - "dependencies": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/monitoring": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@algolia/monitoring/-/monitoring-1.12.0.tgz", - "integrity": "sha512-i2AJZED/zf4uhxezAJUhMKoL5QoepCBp2ynOYol0N76+TSoohaMADdPnWCqOULF4RzOwrG8wWynAwBlXsAI1RQ==", - "dev": true, - "dependencies": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/recommend": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/recommend/-/recommend-5.12.0.tgz", - "integrity": "sha512-0jmZyKvYnB/Bj5c7WKsKedOUjnr0UtXm0LVFUdQrxXfqOqvWv9n6Vpr65UjdYG4Q49kRQxhlwtal9WJYrYymXg==", - "dev": true, - "dependencies": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/requester-browser-xhr": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.12.0.tgz", - "integrity": "sha512-KxwleraFuVoEGCoeW6Y1RAEbgBMS7SavqeyzWdtkJc6mXeCOJXn1iZitb8Tyn2FcpMNUKlSm0adrUTt7G47+Ow==", - "dev": true, - "dependencies": { - "@algolia/client-common": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/requester-fetch": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-fetch/-/requester-fetch-5.12.0.tgz", - "integrity": "sha512-FuDZXUGU1pAg2HCnrt8+q1VGHKChV/LhvjvZlLOT7e56GJie6p+EuLu4/hMKPOVuQQ8XXtrTHKIU3Lw+7O5/bQ==", - "dev": true, - "dependencies": { - "@algolia/client-common": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/@algolia/requester-node-http": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-5.12.0.tgz", - "integrity": "sha512-ncDDY7CxZhMs6LIoPl+vHFQceIBhYPY5EfuGF1V7beO0U38xfsCYEyutEFB2kRzf4D9Gqppn3iWX71sNtrKcuw==", - "dev": true, - "dependencies": { - "@algolia/client-common": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", @@ -471,48 +246,6 @@ "integrity": "sha512-1OorbTwi1eeDmr0v5t+ckSRlt1zM5GHjm92iIl3kUu7im3GHuP+csf6E0WBg8pdXQczTWP9J9+o9n+Vg6DH5cQ==", "dev": true }, - "node_modules/@docsearch/js": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docsearch/js/-/js-3.7.0.tgz", - "integrity": "sha512-ScfqOIKrSr8SImbpxVaD59xc/bytbL8QEM2GUpe3aICmoICflWp5DyTRzAdFky16HY+yEOAVZXt3COXQ1NOCWw==", - "dev": true, - "dependencies": { - "@docsearch/react": "3.7.0", - "preact": "^10.0.0" - } - }, - "node_modules/@docsearch/react": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.7.0.tgz", - "integrity": "sha512-8e6tdDfkYoxafEEPuX5eE1h9cTkLvhe4KgoFkO5JCddXSQONnN1FHcDZRI4r8894eMpbYq6rdJF0dVYh8ikwNQ==", - "dev": true, - "dependencies": { - "@algolia/autocomplete-core": "1.17.6", - "@algolia/autocomplete-preset-algolia": "1.17.6", - "@docsearch/css": "3.7.0", - "algoliasearch": "^5.12.0" - }, - "peerDependencies": { - "@types/react": ">= 16.8.0 < 19.0.0", - "react": ">= 16.8.0 < 19.0.0", - "react-dom": ">= 16.8.0 < 19.0.0", - "search-insights": ">= 1 < 3" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "react": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "search-insights": { - "optional": true - } - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -1198,30 +931,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/algoliasearch": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-5.12.0.tgz", - "integrity": "sha512-psGBRYdGgik8I6m28iAB8xpubvjEt7UQU+w5MAJUA2324WHiGoHap5BPkkjB14rMaXeRts6pmOsrVIglGyOVwg==", - "dev": true, - "dependencies": { - "@algolia/client-abtesting": "5.12.0", - "@algolia/client-analytics": "5.12.0", - "@algolia/client-common": "5.12.0", - "@algolia/client-insights": "5.12.0", - "@algolia/client-personalization": "5.12.0", - "@algolia/client-query-suggestions": "5.12.0", - "@algolia/client-search": "5.12.0", - "@algolia/ingestion": "1.12.0", - "@algolia/monitoring": "1.12.0", - "@algolia/recommend": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - }, - "engines": { - "node": ">= 14.0.0" - } - }, "node_modules/alphanum-sort": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", @@ -2900,9 +2609,9 @@ "dev": true }, "node_modules/caniuse-lite": { - "version": "1.0.30001554", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001554.tgz", - "integrity": "sha512-A2E3U//MBwbJVzebddm1YfNp7Nud5Ip+IPn4BozBmn4KqVX7AvluoIDFWjsv5OkGnKUXQVmMSoMKLa3ScCblcQ==", + "version": "1.0.30001823", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001823.tgz", + "integrity": "sha512-TQ5s/djDjNk1axreUW+4rULH+BmdCMLiJkhaXnO5wqivG7tITkSUj4ItIdzqdZHKaXcHAV8dhH3JxOM7/7bwqw==", "dev": true, "funding": [ { @@ -2917,7 +2626,8 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/caw": { "version": "2.0.1", @@ -12322,16 +12032,6 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, - "node_modules/preact": { - "version": "10.24.3", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.24.3.tgz", - "integrity": "sha512-Z2dPnBnMUfyQfSQ+GBdsGa16hz35YmLmtTLhM169uW944hYL6xzTYkJjC07j+Wosz733pMWx0fgON3JNw1jJQA==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/preact" - } - }, "node_modules/prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -13840,13 +13540,6 @@ "get-assigned-identifiers": "^1.1.0" } }, - "node_modules/search-insights": { - "version": "2.17.2", - "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.17.2.tgz", - "integrity": "sha512-zFNpOpUO+tY2D85KrxJ+aqwnIfdEGi06UH2+xEb+Bp9Mwznmauqc9djbnBibJO5mpfUPPa8st6Sx65+vbeO45g==", - "dev": true, - "peer": true - }, "node_modules/secure-json-parse": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz", @@ -17055,182 +16748,6 @@ "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", "dev": true }, - "@algolia/autocomplete-core": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.17.6.tgz", - "integrity": "sha512-lkDoW4I7h2kKlIgf3pUt1LqvxyYKkVyiypoGLlUnhPSnCpmeOwudM6rNq6YYsCmdQtnDQoW5lUNNuj6ASg3qeg==", - "dev": true, - "requires": { - "@algolia/autocomplete-plugin-algolia-insights": "1.17.6", - "@algolia/autocomplete-shared": "1.17.6" - } - }, - "@algolia/autocomplete-plugin-algolia-insights": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.17.6.tgz", - "integrity": "sha512-17NnaacuFzSWVuZu4NKzVeaFIe9Abpw8w+/gjc7xhZFtqj+GadufzodIdchwiB2eM2cDdiR3icW7gbNTB3K2YA==", - "dev": true, - "requires": { - "@algolia/autocomplete-shared": "1.17.6" - } - }, - "@algolia/autocomplete-preset-algolia": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.17.6.tgz", - "integrity": "sha512-Cvg5JENdSCMuClwhJ1ON1/jSuojaYMiUW2KePm18IkdCzPJj/NXojaOxw58RFtQFpJgfVW8h2E8mEoDtLlMdeA==", - "dev": true, - "requires": { - "@algolia/autocomplete-shared": "1.17.6" - } - }, - "@algolia/autocomplete-shared": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.17.6.tgz", - "integrity": "sha512-aq/3V9E00Tw2GC/PqgyPGXtqJUlVc17v4cn1EUhSc+O/4zd04Uwb3UmPm8KDaYQQOrkt1lwvCj2vG2wRE5IKhw==", - "dev": true, - "requires": {} - }, - "@algolia/client-abtesting": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-abtesting/-/client-abtesting-5.12.0.tgz", - "integrity": "sha512-hx4eVydkm3yrFCFxmcBtSzI/ykt0cZ6sDWch+v3JTgKpD2WtosMJU3Upv1AjQ4B6COSHCOWEX3vfFxW6OoH6aA==", - "dev": true, - "requires": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - } - }, - "@algolia/client-analytics": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-5.12.0.tgz", - "integrity": "sha512-EpTsSv6IW8maCfXCDIptgT7+mQJj7pImEkcNUnxR8yUKAHzTogTXv9yGm2WXOZFVuwstd2i0sImhQ1Vz8RH/hA==", - "dev": true, - "requires": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - } - }, - "@algolia/client-common": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-5.12.0.tgz", - "integrity": "sha512-od3WmO8qxyfNhKc+K3D17tvun3IMs/xMNmxCG9MiElAkYVbPPTRUYMkRneCpmJyQI0hNx2/EA4kZgzVfQjO86Q==", - "dev": true - }, - "@algolia/client-insights": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-insights/-/client-insights-5.12.0.tgz", - "integrity": "sha512-8alajmsYUd+7vfX5lpRNdxqv3Xx9clIHLUItyQK0Z6gwGMbVEFe6YYhgDtwslMAP0y6b0WeJEIZJMLgT7VYpRw==", - "dev": true, - "requires": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - } - }, - "@algolia/client-personalization": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-5.12.0.tgz", - "integrity": "sha512-bUV9HtfkTBgpoVhxFrMkmVPG03ZN1Rtn51kiaEtukucdk3ggjR9Qu1YUfRSU2lFgxr9qJc8lTxwfvhjCeJRcqw==", - "dev": true, - "requires": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - } - }, - "@algolia/client-query-suggestions": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-query-suggestions/-/client-query-suggestions-5.12.0.tgz", - "integrity": "sha512-Q5CszzGWfxbIDs9DJ/QJsL7bP6h+lJMg27KxieEnI9KGCu0Jt5iFA3GkREkgRZxRdzlHbZKkrIzhtHVbSHw/rg==", - "dev": true, - "requires": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - } - }, - "@algolia/client-search": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-5.12.0.tgz", - "integrity": "sha512-R3qzEytgVLHOGNri+bpta6NtTt7YtkvUe/QBcAmMDjW4Jk1P0eBYIPfvnzIPbINRsLxIq9fZs9uAYBgsrts4Zg==", - "dev": true, - "requires": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - } - }, - "@algolia/ingestion": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@algolia/ingestion/-/ingestion-1.12.0.tgz", - "integrity": "sha512-zpHo6qhR22tL8FsdSI4DvEraPDi/019HmMrCFB/TUX98yzh5ooAU7sNW0qPL1I7+S++VbBmNzJOEU9VI8tEC8A==", - "dev": true, - "requires": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - } - }, - "@algolia/monitoring": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@algolia/monitoring/-/monitoring-1.12.0.tgz", - "integrity": "sha512-i2AJZED/zf4uhxezAJUhMKoL5QoepCBp2ynOYol0N76+TSoohaMADdPnWCqOULF4RzOwrG8wWynAwBlXsAI1RQ==", - "dev": true, - "requires": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - } - }, - "@algolia/recommend": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/recommend/-/recommend-5.12.0.tgz", - "integrity": "sha512-0jmZyKvYnB/Bj5c7WKsKedOUjnr0UtXm0LVFUdQrxXfqOqvWv9n6Vpr65UjdYG4Q49kRQxhlwtal9WJYrYymXg==", - "dev": true, - "requires": { - "@algolia/client-common": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - } - }, - "@algolia/requester-browser-xhr": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.12.0.tgz", - "integrity": "sha512-KxwleraFuVoEGCoeW6Y1RAEbgBMS7SavqeyzWdtkJc6mXeCOJXn1iZitb8Tyn2FcpMNUKlSm0adrUTt7G47+Ow==", - "dev": true, - "requires": { - "@algolia/client-common": "5.12.0" - } - }, - "@algolia/requester-fetch": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-fetch/-/requester-fetch-5.12.0.tgz", - "integrity": "sha512-FuDZXUGU1pAg2HCnrt8+q1VGHKChV/LhvjvZlLOT7e56GJie6p+EuLu4/hMKPOVuQQ8XXtrTHKIU3Lw+7O5/bQ==", - "dev": true, - "requires": { - "@algolia/client-common": "5.12.0" - } - }, - "@algolia/requester-node-http": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-5.12.0.tgz", - "integrity": "sha512-ncDDY7CxZhMs6LIoPl+vHFQceIBhYPY5EfuGF1V7beO0U38xfsCYEyutEFB2kRzf4D9Gqppn3iWX71sNtrKcuw==", - "dev": true, - "requires": { - "@algolia/client-common": "5.12.0" - } - }, "@alloc/quick-lru": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", @@ -17329,28 +16846,6 @@ "integrity": "sha512-1OorbTwi1eeDmr0v5t+ckSRlt1zM5GHjm92iIl3kUu7im3GHuP+csf6E0WBg8pdXQczTWP9J9+o9n+Vg6DH5cQ==", "dev": true }, - "@docsearch/js": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docsearch/js/-/js-3.7.0.tgz", - "integrity": "sha512-ScfqOIKrSr8SImbpxVaD59xc/bytbL8QEM2GUpe3aICmoICflWp5DyTRzAdFky16HY+yEOAVZXt3COXQ1NOCWw==", - "dev": true, - "requires": { - "@docsearch/react": "3.7.0", - "preact": "^10.0.0" - } - }, - "@docsearch/react": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.7.0.tgz", - "integrity": "sha512-8e6tdDfkYoxafEEPuX5eE1h9cTkLvhe4KgoFkO5JCddXSQONnN1FHcDZRI4r8894eMpbYq6rdJF0dVYh8ikwNQ==", - "dev": true, - "requires": { - "@algolia/autocomplete-core": "1.17.6", - "@algolia/autocomplete-preset-algolia": "1.17.6", - "@docsearch/css": "3.7.0", - "algoliasearch": "^5.12.0" - } - }, "@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -17850,27 +17345,6 @@ "uri-js": "^4.2.2" } }, - "algoliasearch": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-5.12.0.tgz", - "integrity": "sha512-psGBRYdGgik8I6m28iAB8xpubvjEt7UQU+w5MAJUA2324WHiGoHap5BPkkjB14rMaXeRts6pmOsrVIglGyOVwg==", - "dev": true, - "requires": { - "@algolia/client-abtesting": "5.12.0", - "@algolia/client-analytics": "5.12.0", - "@algolia/client-common": "5.12.0", - "@algolia/client-insights": "5.12.0", - "@algolia/client-personalization": "5.12.0", - "@algolia/client-query-suggestions": "5.12.0", - "@algolia/client-search": "5.12.0", - "@algolia/ingestion": "1.12.0", - "@algolia/monitoring": "1.12.0", - "@algolia/recommend": "5.12.0", - "@algolia/requester-browser-xhr": "5.12.0", - "@algolia/requester-fetch": "5.12.0", - "@algolia/requester-node-http": "5.12.0" - } - }, "alphanum-sort": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", @@ -19207,9 +18681,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001554", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001554.tgz", - "integrity": "sha512-A2E3U//MBwbJVzebddm1YfNp7Nud5Ip+IPn4BozBmn4KqVX7AvluoIDFWjsv5OkGnKUXQVmMSoMKLa3ScCblcQ==", + "version": "1.0.30001823", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001823.tgz", + "integrity": "sha512-TQ5s/djDjNk1axreUW+4rULH+BmdCMLiJkhaXnO5wqivG7tITkSUj4ItIdzqdZHKaXcHAV8dhH3JxOM7/7bwqw==", "dev": true }, "caw": { @@ -26702,12 +26176,6 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, - "preact": { - "version": "10.24.3", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.24.3.tgz", - "integrity": "sha512-Z2dPnBnMUfyQfSQ+GBdsGa16hz35YmLmtTLhM169uW944hYL6xzTYkJjC07j+Wosz733pMWx0fgON3JNw1jJQA==", - "dev": true - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -27798,13 +27266,6 @@ "get-assigned-identifiers": "^1.1.0" } }, - "search-insights": { - "version": "2.17.2", - "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.17.2.tgz", - "integrity": "sha512-zFNpOpUO+tY2D85KrxJ+aqwnIfdEGi06UH2+xEb+Bp9Mwznmauqc9djbnBibJO5mpfUPPa8st6Sx65+vbeO45g==", - "dev": true, - "peer": true - }, "secure-json-parse": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz", diff --git a/package.json b/package.json index a0118e6b..91af21fc 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@antora/logger": "^3.1.4", "@asciidoctor/core": "~2.2", "@asciidoctor/tabs": "1.0.0-beta.6", - "@docsearch/js": "^3.7.0", + "@docsearch/css": "3.7.0", "@floating-ui/dom": "^1.6.12", "@fontsource-variable/roboto-flex": "~5.0", "@fontsource-variable/sora": "^5.0.15", diff --git a/src/css/docsearch.css b/src/css/docsearch.css index 169c8893..c8802bb4 100644 --- a/src/css/docsearch.css +++ b/src/css/docsearch.css @@ -16,12 +16,6 @@ html[data-theme="dark"] .DocSearch .DocSearch-Modal { color: var(--ds-text-secondary); } -.DocSearch .DocSearch-LoadingIndicator svg, -.DocSearch .DocSearch-MagnifierLabel svg { - width: 20px; - height: 20px; -} - .DocSearch .DocSearch-Input { font-size: 1rem; font-weight: 400; @@ -70,23 +64,10 @@ html[data-theme="dark"] .DocSearch .DocSearch-Modal { text-decoration: underline; } -.DocSearch .DocSearch-Search-Icon { - display: none; -} - .DocSearch.DocSearch-Container { backdrop-filter: blur(4px); } -.DocSearch .DocSearch-Button-Container::before, -.DocSearch .DocSearch-MagnifierLabel::before { - font-family: "Material Icons Outlined", sans-serif; - font-weight: 400; - font-size: calc(18 / var(--rem-base) * 1rem); - content: "\e8b6"; - color: var(--ds-text-primary); -} - @media screen and (max-width: 768px) { .DocSearch.DocSearch-Container { position: fixed; @@ -98,11 +79,9 @@ html[data-theme="dark"] .DocSearch .DocSearch-Modal { --docsearch-primary-color: var(--ds-text-primary); --docsearch-text-color: var(--ds-text-primary); --docsearch-spacing: var(--ds-space-2); - --docsearch-icon-stroke-width: 1.4; --docsearch-highlight-color: var(--ds-text-primary); --docsearch-muted-color: var(--ds-text-placeholder); --docsearch-container-background: var(--ds-background-backdrop); - --docsearch-logo-color: var(--ds-text-primary); /* modal */ --docsearch-modal-width: 720px; diff --git a/src/css/site-search.css b/src/css/site-search.css index e20244a9..01afe109 100644 --- a/src/css/site-search.css +++ b/src/css/site-search.css @@ -14,9 +14,10 @@ letter-spacing: 0.02em; } -/* Hide the removed Algolia logo slot without collapsing the footer layout. */ -.DocSearch .DocSearch-Logo:empty { - min-width: 1px; +/* DocSearch's footer lays out its items from right to left, with its logo on the right. The + dialog has no logo, so keep the keyboard shortcuts on the left. */ +.DocSearch .DocSearch-Footer { + justify-content: flex-end; } /* The search button's Ctrl key is a text label, like esc in the dialog's footer. */ @@ -90,6 +91,16 @@ font-size: 12px; } +/* The magnifier in the search button and in the dialog's search field. It keeps the 18px width + of the Material glyph it replaced, so the text beside it stays where it was. */ +.DocSearch .DocSearch-Button-Container .icon-search, +.DocSearch .DocSearch-MagnifierLabel .icon-search { + width: 18px; + font-size: 15px; + line-height: 1; + color: var(--ds-text-primary); +} + /* The lines that join a page's matching sections to it: one down the side, one across to each section (the last section's line stops there). */ .DocSearch .DocSearch-Hit-Tree { diff --git a/src/js/vendor/docsearch.bundle.js b/src/js/vendor/docsearch.bundle.js deleted file mode 100644 index 48ff4d3a..00000000 --- a/src/js/vendor/docsearch.bundle.js +++ /dev/null @@ -1 +0,0 @@ -window.docsearch = require('@docsearch/js') diff --git a/src/js/vendor/site-search.js b/src/js/vendor/site-search.js index b7b9413e..c6db3567 100644 --- a/src/js/vendor/site-search.js +++ b/src/js/vendor/site-search.js @@ -19,7 +19,7 @@ var MAX_PAGES = 12 // distinct pages shown for a query var MAX_SECTIONS = 3 // matching sections shown under a page var RECENT_KEY = 'site-search:recent:' + siteRootKey() - var RECENT_MAX = 6 + var RECENT_MAX = 7 // as many as DocSearch keeps var PLATFORM = (navigator.userAgentData && navigator.userAgentData.platform) || navigator.platform || '' var IS_MAC = /(Mac|iPhone|iPod|iPad)/i.test(PLATFORM) @@ -34,6 +34,7 @@ // Icons are Lucide glyphs from the UI's icon font (lucide-static). The lines that join a page's // sections to it are drawn in CSS (site-search.css). var ICONS = { + search: icon('search'), spinner: icon('loader-circle'), reset: icon('x'), page: icon('file-text'), @@ -713,6 +714,7 @@ '