Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
monilpat authored Jan 4, 2025
2 parents 532e28f + 6e30c41 commit 42ba222
Show file tree
Hide file tree
Showing 24 changed files with 2,889 additions and 182 deletions.
39 changes: 28 additions & 11 deletions .github/workflows/jsdoc-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,32 @@ name: JSDoc Automation
on:
workflow_dispatch:
inputs:
jsdoc:
description: 'Generate JSDoc comments (T/F)'
required: true
default: 'T'
type: string
readme:
description: 'Generate README documentation (T/F)'
required: true
default: 'T'
type: string
pull_number:
description: 'Pull Request Number (if not provided, scans root_directory) - PR must be merged to develop branch'
description: 'Pull Request Number (if not provided, scans root_directory) - PR must be merged to develop branch. DONT provide if `README documentation` is T from above'
required: false
type: string
root_directory:
description: 'Only scans files in this directory (relative to repository root, e.g., packages/core/src)'
required: true
default: 'packages/core/src/test_resources'
default: 'packages/plugin-near/'
type: string
excluded_directories:
description: 'Directories to exclude from scanning (comma-separated, relative to root_directory)'
required: true
default: 'node_modules,dist,test'
type: string
reviewers:
description: 'Pull Request Reviewers (comma-separated GitHub usernames)'
description: 'Pull Request Reviewers (Must be collaborator on the repository) comma-separated GitHub usernames'
required: true
default: ''
type: string
Expand All @@ -27,6 +37,11 @@ on:
required: false
default: 'develop'
type: string
language:
description: 'Documentation language (e.g., English, Spanish, French)'
required: true
default: 'English'
type: string

jobs:
generate-docs:
Expand All @@ -45,7 +60,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '23'
node-version: '20'

- name: Install pnpm
uses: pnpm/action-setup@v2
Expand All @@ -71,17 +86,19 @@ jobs:
working-directory: scripts/jsdoc-automation
run: pnpm install --no-frozen-lockfile

- name: Build TypeScript
working-directory: scripts/jsdoc-automation
run: pnpm build

- name: Run documentation generator
working-directory: scripts/jsdoc-automation
run: |
echo "Node version: $(node --version)"
echo "NPM version: $(npm --version)"
echo "Directory contents:"
ls -la
NODE_OPTIONS='--experimental-vm-modules --no-warnings' pnpm start
run: pnpm start
env:
INPUT_ROOT_DIRECTORY: ${{ inputs.root_directory }}
INPUT_PULL_NUMBER: ${{ inputs.pull_number }}
INPUT_EXCLUDED_DIRECTORIES: ${{ inputs.excluded_directories }}
INPUT_REVIEWERS: ${{ inputs.reviewers }}
INPUT_BRANCH: ${{ inputs.branch }}
INPUT_BRANCH: ${{ inputs.branch }}
INPUT_LANGUAGE: ${{ inputs.language }}
INPUT_JSDOC: ${{ inputs.jsdoc }}
INPUT_README: ${{ inputs.readme }}
58 changes: 58 additions & 0 deletions Dockerfile.docs
Original file line number Diff line number Diff line change
@@ -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"]

6 changes: 3 additions & 3 deletions client/src/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export default function Chat() {
: "justify-start"
}`}
>
<div
className={`max-w-[80%] rounded-lg px-4 py-2 ${
<pre
className={`max-w-[80%] rounded-lg px-4 py-2 whitespace-pre-wrap ${
message.user === "user"
? "bg-primary text-primary-foreground"
: "bg-muted"
Expand All @@ -115,7 +115,7 @@ export default function Chat() {
/>
)
))}
</div>
</pre>
</div>
))
) : (
Expand Down
9 changes: 9 additions & 0 deletions docker-compose-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
docs:
build:
dockerfile: Dockerfile.docs
context: .
target: serve
ports:
- 3000:3000

10 changes: 10 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
8 changes: 4 additions & 4 deletions docs/docs/packages/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
3 changes: 3 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "eliza-docs",
"version": "0.1.7-alpha.2",
"private": true,
"packageManager": "[email protected]",
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start --no-open",
Expand All @@ -21,9 +22,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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { composeContext } from "@elizaos/core";
import { generateText, trimTokens } from "@elizaos/core";
import type { TiktokenModel } from "js-tiktoken";
import { models } from "@elizaos/core";
import { parseJSONObjectFromText } from "@elizaos/core";
import {
Expand Down
Loading

0 comments on commit 42ba222

Please sign in to comment.