From 0f332e7b0b6245ab812558009103038cf4212dbf Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Mon, 23 Oct 2023 11:14:44 +0200 Subject: [PATCH 01/10] test: retry compose down before erroring out --- tests/docker/manageDocker.sh | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tests/docker/manageDocker.sh diff --git a/tests/docker/manageDocker.sh b/tests/docker/manageDocker.sh new file mode 100644 index 000000000..8f64c3d76 --- /dev/null +++ b/tests/docker/manageDocker.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Maximum number of attempts to bring down the Docker Compose +max_attempts=5 + +# Counter for the number of attempts +attempt=0 + +# Path to your docker-compose file +compose_file="tests/docker/docker-compose.yml" + +# Function to bring up the services +start_services() { + docker-compose -f $compose_file up -d +} + +# Loop to attempt 'docker-compose down' with retries +while [ $attempt -lt $max_attempts ]; do + # Increment the attempt counter + ((attempt=attempt+1)) + + # Try to bring down the services + docker-compose -f $compose_file down + + # Check if the command succeeded + if [ $? -eq 0 ]; then + echo "Successfully brought down the services." + # If successful, break out of the loop + break + else + echo "Attempt $attempt failed..." + # If max attempts reached, show error and exit + if [ $attempt -eq $max_attempts ]; then + echo "Failed to bring down the services after $max_attempts attempts." + exit 1 + fi + # If not, wait for a bit before retrying + echo "Retrying in 5 seconds..." + sleep 5 + fi +done + +# If we reached here, it means we successfully brought the services down. +# So we start them up again. +start_services From a245d7f49ca1bd208cc9489be199e8f2b309929f Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Mon, 23 Oct 2023 11:16:58 +0200 Subject: [PATCH 02/10] test: use new script to manage docker on action run --- .github/workflows/cypress-nightly.yml | 2 +- .github/workflows/examples-nightly.yml | 2 +- .github/workflows/goth-nightly.yml | 2 +- .github/workflows/release.yml | 2 +- tests/docker/Requestor.Dockerfile | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cypress-nightly.yml b/.github/workflows/cypress-nightly.yml index ca7253bf4..6cf4b4440 100644 --- a/.github/workflows/cypress-nightly.yml +++ b/.github/workflows/cypress-nightly.yml @@ -24,7 +24,7 @@ jobs: - name: Start the docker containers # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 - run: docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d + run: /manageDocker.sh - name: Fund the requestor # Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry. diff --git a/.github/workflows/examples-nightly.yml b/.github/workflows/examples-nightly.yml index a5daacefd..ad7612ae8 100644 --- a/.github/workflows/examples-nightly.yml +++ b/.github/workflows/examples-nightly.yml @@ -40,7 +40,7 @@ jobs: - name: Start the docker containers # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 - run: docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d + run: /manageDocker.sh - name: Fund the requestor # Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry. diff --git a/.github/workflows/goth-nightly.yml b/.github/workflows/goth-nightly.yml index ca10cb93d..4e583f6bb 100644 --- a/.github/workflows/goth-nightly.yml +++ b/.github/workflows/goth-nightly.yml @@ -40,7 +40,7 @@ jobs: - name: Start the docker containers # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 - run: docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d + run: /manageDocker.sh - name: Fund the requestor # Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef1b52405..d1a73088b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,7 +63,7 @@ jobs: - name: Start the docker containers # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 - run: docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d + run: /manageDocker.sh - name: Fund the requestor # Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry. diff --git a/tests/docker/Requestor.Dockerfile b/tests/docker/Requestor.Dockerfile index b64167fdd..2b56c5f76 100644 --- a/tests/docker/Requestor.Dockerfile +++ b/tests/docker/Requestor.Dockerfile @@ -40,5 +40,6 @@ RUN apt-get update -q \ COPY ./startRequestor.sh /startRequestor.sh +COPY ./manageDocker.sh /manageDocker.sh CMD ["bash", "-c", "/startRequestor.sh"] From 13e3eb1dca86f9ae7653945bd7ff5ce35873483f Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Mon, 23 Oct 2023 11:30:46 +0200 Subject: [PATCH 03/10] test: use correct file path --- .github/workflows/cypress-nightly.yml | 2 +- .github/workflows/examples-nightly.yml | 2 +- .github/workflows/goth-nightly.yml | 2 +- .github/workflows/release.yml | 2 +- tests/docker/Requestor.Dockerfile | 1 - tests/docker/{manageDocker.sh => startDocker.sh} | 0 6 files changed, 4 insertions(+), 5 deletions(-) rename tests/docker/{manageDocker.sh => startDocker.sh} (100%) mode change 100644 => 100755 diff --git a/.github/workflows/cypress-nightly.yml b/.github/workflows/cypress-nightly.yml index 6cf4b4440..f8e07d128 100644 --- a/.github/workflows/cypress-nightly.yml +++ b/.github/workflows/cypress-nightly.yml @@ -24,7 +24,7 @@ jobs: - name: Start the docker containers # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 - run: /manageDocker.sh + run: tests/docker/startDocker.sh - name: Fund the requestor # Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry. diff --git a/.github/workflows/examples-nightly.yml b/.github/workflows/examples-nightly.yml index ad7612ae8..0b4fd7de3 100644 --- a/.github/workflows/examples-nightly.yml +++ b/.github/workflows/examples-nightly.yml @@ -40,7 +40,7 @@ jobs: - name: Start the docker containers # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 - run: /manageDocker.sh + run: tests/docker/startDocker.sh - name: Fund the requestor # Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry. diff --git a/.github/workflows/goth-nightly.yml b/.github/workflows/goth-nightly.yml index 4e583f6bb..fcbc66d25 100644 --- a/.github/workflows/goth-nightly.yml +++ b/.github/workflows/goth-nightly.yml @@ -40,7 +40,7 @@ jobs: - name: Start the docker containers # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 - run: /manageDocker.sh + run: tests/docker/startDocker.sh - name: Fund the requestor # Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d1a73088b..9ac91d286 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,7 +63,7 @@ jobs: - name: Start the docker containers # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 - run: /manageDocker.sh + run: tests/docker/startDocker.sh - name: Fund the requestor # Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry. diff --git a/tests/docker/Requestor.Dockerfile b/tests/docker/Requestor.Dockerfile index 2b56c5f76..b64167fdd 100644 --- a/tests/docker/Requestor.Dockerfile +++ b/tests/docker/Requestor.Dockerfile @@ -40,6 +40,5 @@ RUN apt-get update -q \ COPY ./startRequestor.sh /startRequestor.sh -COPY ./manageDocker.sh /manageDocker.sh CMD ["bash", "-c", "/startRequestor.sh"] diff --git a/tests/docker/manageDocker.sh b/tests/docker/startDocker.sh old mode 100644 new mode 100755 similarity index 100% rename from tests/docker/manageDocker.sh rename to tests/docker/startDocker.sh From a014c73c48108a5c89d1e0d78277403c8e6d0454 Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Mon, 23 Oct 2023 11:32:51 +0200 Subject: [PATCH 04/10] test: fix command --- tests/docker/startDocker.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/docker/startDocker.sh b/tests/docker/startDocker.sh index 8f64c3d76..ca5df56e3 100755 --- a/tests/docker/startDocker.sh +++ b/tests/docker/startDocker.sh @@ -11,16 +11,16 @@ compose_file="tests/docker/docker-compose.yml" # Function to bring up the services start_services() { - docker-compose -f $compose_file up -d + docker compose -f $compose_file up -d } -# Loop to attempt 'docker-compose down' with retries +# Loop to attempt 'docker compose down' with retries while [ $attempt -lt $max_attempts ]; do # Increment the attempt counter ((attempt=attempt+1)) # Try to bring down the services - docker-compose -f $compose_file down + docker compose -f $compose_file down # Check if the command succeeded if [ $? -eq 0 ]; then From 44d2be60246f31e23382f938d440cbe81e8a45eb Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Mon, 23 Oct 2023 11:36:09 +0200 Subject: [PATCH 05/10] test: restart docker service --- tests/docker/startDocker.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/docker/startDocker.sh b/tests/docker/startDocker.sh index ca5df56e3..b5f5a24fd 100755 --- a/tests/docker/startDocker.sh +++ b/tests/docker/startDocker.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Restart docker first as it may be in a bad state. +sudo service docker restart # Maximum number of attempts to bring down the Docker Compose max_attempts=5 From cee329a29ef9418c379b3ad5f56fc06b8c4cdf9a Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Tue, 24 Oct 2023 08:23:32 +0200 Subject: [PATCH 06/10] test: scratch script and just restart docker --- .github/workflows/cypress-nightly.yml | 2 +- .github/workflows/examples-nightly.yml | 2 +- .github/workflows/goth-nightly.yml | 2 +- .github/workflows/release.yml | 6 ++-- tests/docker/startDocker.sh | 47 -------------------------- 5 files changed, 6 insertions(+), 53 deletions(-) delete mode 100755 tests/docker/startDocker.sh diff --git a/.github/workflows/cypress-nightly.yml b/.github/workflows/cypress-nightly.yml index f8e07d128..9cfdee853 100644 --- a/.github/workflows/cypress-nightly.yml +++ b/.github/workflows/cypress-nightly.yml @@ -24,7 +24,7 @@ jobs: - name: Start the docker containers # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 - run: tests/docker/startDocker.sh + run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d - name: Fund the requestor # Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry. diff --git a/.github/workflows/examples-nightly.yml b/.github/workflows/examples-nightly.yml index 0b4fd7de3..7d2f311d9 100644 --- a/.github/workflows/examples-nightly.yml +++ b/.github/workflows/examples-nightly.yml @@ -40,7 +40,7 @@ jobs: - name: Start the docker containers # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 - run: tests/docker/startDocker.sh + run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d - name: Fund the requestor # Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry. diff --git a/.github/workflows/goth-nightly.yml b/.github/workflows/goth-nightly.yml index fcbc66d25..34f9aeeca 100644 --- a/.github/workflows/goth-nightly.yml +++ b/.github/workflows/goth-nightly.yml @@ -40,7 +40,7 @@ jobs: - name: Start the docker containers # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 - run: tests/docker/startDocker.sh + run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d - name: Fund the requestor # Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ac91d286..3c2d26a74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,15 +55,15 @@ jobs: uses: actions/checkout@v3 - name: Use random string for subnet + # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV - name: Build the docker containers - # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 run: docker compose -f tests/docker/docker-compose.yml build - name: Start the docker containers - # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 - run: tests/docker/startDocker.sh + # Restart docker to avoid issues with the docker compose down due to improper cleanup of the previous run. + run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d - name: Fund the requestor # Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry. diff --git a/tests/docker/startDocker.sh b/tests/docker/startDocker.sh deleted file mode 100755 index b5f5a24fd..000000000 --- a/tests/docker/startDocker.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# Restart docker first as it may be in a bad state. -sudo service docker restart -# Maximum number of attempts to bring down the Docker Compose -max_attempts=5 - -# Counter for the number of attempts -attempt=0 - -# Path to your docker-compose file -compose_file="tests/docker/docker-compose.yml" - -# Function to bring up the services -start_services() { - docker compose -f $compose_file up -d -} - -# Loop to attempt 'docker compose down' with retries -while [ $attempt -lt $max_attempts ]; do - # Increment the attempt counter - ((attempt=attempt+1)) - - # Try to bring down the services - docker compose -f $compose_file down - - # Check if the command succeeded - if [ $? -eq 0 ]; then - echo "Successfully brought down the services." - # If successful, break out of the loop - break - else - echo "Attempt $attempt failed..." - # If max attempts reached, show error and exit - if [ $attempt -eq $max_attempts ]; then - echo "Failed to bring down the services after $max_attempts attempts." - exit 1 - fi - # If not, wait for a bit before retrying - echo "Retrying in 5 seconds..." - sleep 5 - fi -done - -# If we reached here, it means we successfully brought the services down. -# So we start them up again. -start_services From c6d7989522c7ca530af573513e34c7f12b29b48e Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Tue, 24 Oct 2023 09:32:17 +0200 Subject: [PATCH 07/10] test(example): reduce custom price array length check --- .../examples/selecting-providers/custom-price.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/docs-examples/examples/selecting-providers/custom-price.mjs b/examples/docs-examples/examples/selecting-providers/custom-price.mjs index d4a604006..411bbaa84 100644 --- a/examples/docs-examples/examples/selecting-providers/custom-price.mjs +++ b/examples/docs-examples/examples/selecting-providers/custom-price.mjs @@ -12,10 +12,10 @@ const myFilter = async (proposal) => { let counterIdx = usageVector.findIndex((ele) => ele === "golem.usage.duration_sec"); let proposedCost = proposal.properties["golem.com.pricing.model.linear.coeffs"][counterIdx]; costData.push(proposedCost); - if (costData.length < 11) return false; + if (costData.length < 6) return false; else { costData.shift(); - let averageProposedCost = costData.reduce((part, x) => part + x, 0) / 10; + let averageProposedCost = costData.reduce((part, x) => part + x, 0) / 5; if (proposedCost <= 1.2 * averageProposedCost) decision = true; if (decision) { console.log(proposedCost, averageProposedCost); From 458423cb8654e75e20b198b5f4a9d41bc1e7f6d0 Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Tue, 24 Oct 2023 10:18:57 +0200 Subject: [PATCH 08/10] test: update comments --- .github/workflows/cypress-nightly.yml | 4 ++-- .github/workflows/examples-nightly.yml | 4 ++-- .github/workflows/goth-nightly.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cypress-nightly.yml b/.github/workflows/cypress-nightly.yml index 9cfdee853..65f60f231 100644 --- a/.github/workflows/cypress-nightly.yml +++ b/.github/workflows/cypress-nightly.yml @@ -16,14 +16,14 @@ jobs: uses: actions/checkout@v3 - name: Use random string for subnet + # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV - name: Build the docker containers - # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 run: docker compose -f tests/docker/docker-compose.yml build - name: Start the docker containers - # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 + # Restart docker to avoid issues with the docker compose down due to improper cleanup of the previous run. run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d - name: Fund the requestor diff --git a/.github/workflows/examples-nightly.yml b/.github/workflows/examples-nightly.yml index 7d2f311d9..9ddb33568 100644 --- a/.github/workflows/examples-nightly.yml +++ b/.github/workflows/examples-nightly.yml @@ -32,14 +32,14 @@ jobs: uses: actions/checkout@v3 - name: Use random string for subnet + # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV - name: Build the docker containers - # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 run: docker compose -f tests/docker/docker-compose.yml build - name: Start the docker containers - # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 + # Restart docker to avoid issues with the docker compose down due to improper cleanup of the previous run. run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d - name: Fund the requestor diff --git a/.github/workflows/goth-nightly.yml b/.github/workflows/goth-nightly.yml index 34f9aeeca..f6c4cd505 100644 --- a/.github/workflows/goth-nightly.yml +++ b/.github/workflows/goth-nightly.yml @@ -32,14 +32,14 @@ jobs: uses: actions/checkout@v3 - name: Use random string for subnet + # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV - name: Build the docker containers - # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 run: docker compose -f tests/docker/docker-compose.yml build - name: Start the docker containers - # Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 + # Restart docker to avoid issues with the docker compose down due to improper cleanup of the previous run. run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d - name: Fund the requestor From a3b94ca8256a951bac04f040783743362fe16583 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Thu, 9 Nov 2023 09:05:40 +0100 Subject: [PATCH 09/10] ci: update dependabot.yml --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3a3cce576..77c0a3c8c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,5 +7,6 @@ version: 2 updates: - package-ecosystem: "npm" # See documentation for possible values directory: "/" # Location of package manifests + target-branch: "beta" schedule: interval: "weekly" From fc847857d5aab850836fce9d8c519f42c7bca35f Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Thu, 9 Nov 2023 11:05:58 +0100 Subject: [PATCH 10/10] docs: update the frontmatter --- .docs/summary-generator.cjs | 2 +- .docs/typedoc-frontmatter-theme.cjs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.docs/summary-generator.cjs b/.docs/summary-generator.cjs index fa177f315..012acc63b 100644 --- a/.docs/summary-generator.cjs +++ b/.docs/summary-generator.cjs @@ -34,7 +34,7 @@ async function prepareDocAnchor(docsDir, type, file) { logStream.write(`--- title: golem-js API reference overview description: Dive into the content overview of the Golem-JS API reference. -type: reference +type: JS API Reference --- `); diff --git a/.docs/typedoc-frontmatter-theme.cjs b/.docs/typedoc-frontmatter-theme.cjs index 97e0a8c09..3711c7af8 100644 --- a/.docs/typedoc-frontmatter-theme.cjs +++ b/.docs/typedoc-frontmatter-theme.cjs @@ -10,11 +10,12 @@ class ModifiedHugoTheme extends HugoTheme { onHugoPageEnd(page) { const yamlVars = { - title: `${typedoc.ReflectionKind[page.model.kind]} ${this.getPageTitle(page)} - golem-js API Reference`, + title: `${typedoc.ReflectionKind[page.model.kind]} ${this.getPageTitle(page)}`, + pageTitle: `${typedoc.ReflectionKind[page.model.kind]} ${this.getPageTitle(page)} - golem-js API Reference`, description: `Explore the detailed API reference documentation for the ${ typedoc.ReflectionKind[page.model.kind] } ${this.getPageTitle(page)} within the golem-js SDK for the Golem Network.`, - type: "reference", + type: "JS API Reference", }; page.contents && (page.contents = this.prependYAML(page.contents, yamlVars)); } @@ -31,7 +32,7 @@ class ModifiedHugoTheme extends HugoTheme { return ( "---\n" + Object.entries(yamlVars) - .map(([key, value]) => `${key}: "${value}"`) + .map(([key, value]) => `${key}: ${value}`) .join("\n") + "\n---\n" + contents