From 6f77bf051a73164eaf314e970de18d68e05cbd9b Mon Sep 17 00:00:00 2001 From: Marcello DeSales Date: Thu, 2 Jan 2025 20:44:38 -0800 Subject: [PATCH 1/5] :books: add section to docs/README.md for dockerized docs --- docs/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/README.md b/docs/README.md index 5e4da17b9a..3b1791b826 100644 --- a/docs/README.md +++ b/docs/README.md @@ -179,3 +179,13 @@ Tests are written using Jest and can be found in `src/**/*.test.ts` files. The t - Run tests in sequence (--runInBand) To create new tests, add a `.test.ts` file adjacent to the code you're testing. + +## Docs Updates + +Please make sure to vetify if the documentation provided is correct. In order to do so, please run the docs service. + +```console +docker compose -f docker-compose-docs.yaml up --build +``` + +The docusaurus server will get started and you can verify it locally at https://localhost:3000/eliza. From d65f7f0da7d650f52b0180c1ccd0246907c674c9 Mon Sep 17 00:00:00 2001 From: Marcello DeSales Date: Thu, 2 Jan 2025 20:27:08 -0800 Subject: [PATCH 2/5] :whale: :new: add Dockerfile.docs and update docker-compose MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the docs dependend on the files from packages, we have to include the Dockerfile.docs in the root directory because of the build context. Adding a new docker-compose-docs.yaml to always build the docs from the file directly. Just adding a new service for the docs: $ docker compose up --build [+] Building 55.5s (20/20) FINISHED docker:desktop-linux => [docs internal] load build definition from Dockerfile.docs 0.0s => => transferring dockerfile: 1.88kB 0.0s => [docs] resolve image config for docker.io/docker/dockerfile:1 1.7s => CACHED [docs] docker-image://docker.io/docker/dockerfile:1@sha256:93bfd3b68c109427185cd78b4779fc82b484b0b7618e36d0f104d4d801e66d25 0.0s => [docs internal] load build definition from Dockerfile.docs 0.0s => [docs internal] load metadata for docker.io/library/node:23.3.0-slim 1.3s => [docs internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [docs base 1/4] FROM docker.io/library/node:23.3.0-slim@sha256:8b30809f66a6ea8896b9a5d004b4fe2cc0e8061d981d3784fb0e80a19b86ab9d 0.0s => [docs internal] load build context 0.1s => => transferring context: 409.46kB 0.1s => CACHED [docs base 2/4] RUN corepack enable 0.0s => CACHED [docs base 3/4] WORKDIR /opt/docusaurus 0.0s => CACHED [docs base 4/4] RUN apt-get update && apt-get install -y git 0.0s => CACHED [docs prod 1/8] WORKDIR /opt/docusaurus 0.0s => CACHED [docs prod 2/8] COPY docs/package.json /opt/docusaurus/package.json 0.0s => CACHED [docs prod 3/8] COPY docs/package-lock.json /opt/docusaurus/package-lock.json 0.0s => CACHED [docs prod 4/8] RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install 0.0s => CACHED [docs prod 5/8] COPY docs/ /opt/docusaurus/ 0.0s => CACHED [docs prod 6/8] COPY packages/ /opt/packages/ 0.0s => [docs prod 7/8] COPY .git/ /opt/.git/ 0.1s => [docs prod 8/8] RUN pnpm run build 51.4s => [docs] exporting to image 0.8s => => exporting layers 0.8s => => writing image sha256:0a580f2889191121880df85b8951563386f838f7e5f8723dec750ce292334498 0.0s => => naming to docker.io/library/eliza-docs 0.0s [+] Running 1/0 ✔ Container eliza-docs-1 Recreated 0.0s Attaching to docs-1 docs-1 | (node:1) ExperimentalWarning: CommonJS module /usr/local/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /usr/local/lib/node_modules/npm/node_modules/supports-color/index.js using require(). docs-1 | Support for loading ES Module in require() is an experimental feature and might change at any time docs-1 | (Use `node --trace-warnings ...` to show where the warning was created) docs-1 | docs-1 | > eliza-docs@0.1.7-alpha.2 serve docs-1 | > docusaurus serve --host 0.0.0.0 --no-open docs-1 | docs-1 | [SUCCESS] Serving "build" directory at: http://0.0.0.0:3000/eliza/ --- Dockerfile.docs | 58 ++++++++++++++++++++++++++++++++++++++++ docker-compose-docs.yaml | 9 +++++++ 2 files changed, 67 insertions(+) create mode 100644 Dockerfile.docs create mode 100644 docker-compose-docs.yaml diff --git a/Dockerfile.docs b/Dockerfile.docs new file mode 100644 index 0000000000..ae2ea6bf14 --- /dev/null +++ b/Dockerfile.docs @@ -0,0 +1,58 @@ +# syntax=docker/dockerfile:1 + +## Modified version of https://docusaurus.community/knowledge/deployment/docker/ + +# Stage 1: Base image. +## Start with a base image containing NodeJS so we can build Docusaurus. +FROM node:23.3.0-slim AS base +## Disable colour output from yarn to make logs easier to read. + +## https://pnpm.io/docker +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" + +ENV FORCE_COLOR=0 +## Enable corepack. +RUN corepack enable +## Set the working directory to `/opt/docusaurus`. +WORKDIR /opt/docusaurus + +## Required by docusaurus: [ERROR] Loading of version failed for version current +RUN apt-get update && apt-get install -y git + +FROM base AS dev +## Set the working directory to `/opt/docusaurus`. +WORKDIR /opt/docusaurus +## Expose the port that Docusaurus will run on. +EXPOSE 3000 +## Run the development server. +CMD [ -d "node_modules" ] && npm run start -- --host 0.0.0.0 --poll 1000 || pnpm install && pnpm run start -- --host 0.0.0.0 --poll 1000 + +# Stage 2b: Production build mode. +FROM base AS prod +## Set the working directory to `/opt/docusaurus`. +WORKDIR /opt/docusaurus + +COPY docs/package.json /opt/docusaurus/package.json +COPY docs/package-lock.json /opt/docusaurus/package-lock.json + +## Install dependencies with `--immutable` to ensure reproducibility. +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install + +## Copy over the source code. +COPY docs/ /opt/docusaurus/ +COPY packages/ /opt/packages/ + +## Required buy docusaurus [ERROR] Loading of version failed for version current +COPY .git/ /opt/.git/ + +# Build from sources +RUN pnpm run build + +# Stage 3a: Serve with `docusaurus serve`. +FROM prod AS serve +## Expose the port that Docusaurus will run on. +EXPOSE 3000 +## Run the production server. +CMD ["npm", "run", "serve", "--", "--host", "0.0.0.0", "--no-open"] + diff --git a/docker-compose-docs.yaml b/docker-compose-docs.yaml new file mode 100644 index 0000000000..5103dea5dc --- /dev/null +++ b/docker-compose-docs.yaml @@ -0,0 +1,9 @@ +services: + docs: + build: + dockerfile: Dockerfile.docs + context: . + target: serve + ports: + - 3000:3000 + From 1290dc4acad4dc567dab5b638f51da44de1a94d6 Mon Sep 17 00:00:00 2001 From: Marcello DeSales Date: Thu, 2 Jan 2025 20:15:54 -0800 Subject: [PATCH 3/5] :bug: fix missing packages from docs/package.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While trying to build within a docker image, here are the missing packages. 40.12 40.12 -------------------------- 40.12 40.12 Module not found: Error: Can't resolve 'lunr' in '/opt/docusaurus/.docusaurus' 40.12 40.12 -------------------------- 40.12 40.12 Module not found: Error: Can't resolve '@docusaurus/theme-common' in '/opt/docusaurus/community/components' 40.18  ELIFECYCLE  Command failed with exit code 1. ------ failed to solve: process "/bin/sh -c pnpm run build" did not complete successfully: exit code: 1 --- docs/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/package.json b/docs/package.json index 4956c66cf9..a563fa9fe5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -21,9 +21,11 @@ "@docusaurus/plugin-ideal-image": "3.6.3", "@docusaurus/preset-classic": "3.6.3", "@docusaurus/theme-mermaid": "3.6.3", + "@docusaurus/theme-common": "3.6.3", "@mdx-js/react": "3.0.1", "clsx": "2.1.1", "docusaurus-lunr-search": "3.5.0", + "lunr": "2.3.9", "dotenv": "^16.4.7", "prism-react-renderer": "2.3.1", "react": "18.3.1", From 4fb50aec66ef46b376c4590c390652f981d534e3 Mon Sep 17 00:00:00 2001 From: Marcello DeSales Date: Thu, 2 Jan 2025 20:14:17 -0800 Subject: [PATCH 4/5] :recycle: add packageManager to docs/package.json > [prod 3/4] RUN pnpm ci: 0.645 /usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22090 0.645 throw new UsageError(`No version specified for ${raw2} in "packageManager" of ${source}`); 0.645 ^ 0.645 0.645 UsageError: No version specified for pnpm in "packageManager" of package.json 0.645 at parseSpec (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22090:13) 0.645 at loadSpec (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22164:11) 0.645 at async Engine.findProjectSpec (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22354:22) 0.645 at async Engine.executePackageManagerRequest (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22410:24) 0.645 at async Object.runMain (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23102:5) { 0.645 clipanion: { type: 'usage' } 0.645 } --- docs/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/package.json b/docs/package.json index a563fa9fe5..3cd7c59c18 100644 --- a/docs/package.json +++ b/docs/package.json @@ -2,6 +2,7 @@ "name": "eliza-docs", "version": "0.1.7-alpha.2", "private": true, + "packageManager": "pnpm@9.4.0", "scripts": { "docusaurus": "docusaurus", "start": "docusaurus start --no-open", From bf4d5d085de98fe12a767bad7e981ff686449d0b Mon Sep 17 00:00:00 2001 From: Marcello DeSales Date: Thu, 2 Jan 2025 20:05:32 -0800 Subject: [PATCH 5/5] :bug: fix plugins.md formatting for docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Can't build the docs because of the following: docs/docs/packages/plugins.md 39.56 [webpackbar] ✔ Client: Compiled with some errors in 37.40s 39.56 [ERROR] Client bundle compiled with errors therefore further build is impossible. 39.56 Error: MDX compilation failed for file "/opt/docusaurus/docs/packages/plugins.md" 39.56 Cause: Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc 39.56 Details: 39.56 { 39.56 "column": 1, 39.56 "message": "Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", 39.56 "line": 617, 39.56 "name": "617:1", 39.56 "place": { 39.56 "_bufferIndex": 0, 39.56 "_index": 10, 39.56 "line": 617, 39.56 "column": 1, 39.56 "offset": 21207 39.56 }, 39.56 "reason": "Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", 39.56 "ruleId": "unexpected-lazy", 39.56 "source": "micromark-extension-mdx-expression", 39.56 "url": "https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed" 39.56 } 39.56 39.56 -------------------------- --- docs/docs/packages/plugins.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/packages/plugins.md b/docs/docs/packages/plugins.md index 8e13cf7062..50e01a8419 100644 --- a/docs/docs/packages/plugins.md +++ b/docs/docs/packages/plugins.md @@ -610,12 +610,12 @@ The Fuel plugin provides an interface to the Fuel Ignition blockchain. **Actions:** 1. `TRANSFER_FUEL_ETH` - Transfer ETH to a given Fuel address. - **Inputs**: - `toAddress` (string): The Fuel address to transfer ETH to. - `amount` (string): The amount of ETH to transfer. - **Outputs**: Confirmation message with transaction details. - **Example**: - `json -{ + ```json + { "toAddress": "0x8F8afB12402C9a4bD9678Bec363E51360142f8443FB171655eEd55dB298828D1", "amount": "0.00001" -} -` + } + ``` **Setup and Configuration:** 1. **Configure the Plugin**