Skip to content

chore: organize ts files and tooling #466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"

- name: Install Poetry
uses: snok/install-poetry@v1
@@ -44,29 +44,29 @@ jobs:
with:
node-version: "18"
cache: "npm"
# Install dependencies in parent directory first
- run: npm install
# formatting/lint in working directory
cache-dependency-path: ./typescript
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- name: Check formatting/lint
working-directory: ./typescript
run: |
npm ci
npm run format:check
npm run lint

check-package-lock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"

- name: Run npm install
run: npm install

cache-dependency-path: ./typescript

- name: Check if package-lock.json changed
working-directory: ./typescript
run: |
npm install
if [ -n "$(git diff package-lock.json)" ]; then
echo "Error: package-lock.json was modified after running npm install. Please commit the updated package-lock.json file."
git diff package-lock.json
@@ -77,11 +77,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"

- name: Install Poetry
uses: snok/install-poetry@v1
6 changes: 4 additions & 2 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
@@ -14,10 +14,12 @@ jobs:
with:
node-version: "18"
cache: "npm"
cache-dependency-path: ./typescript

- name: Install and Build JSDocs
working-directory: ./typescript
run: |
npm i
npm ci
npm run build
npm run docs

@@ -34,7 +36,7 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"

- name: Install Poetry
uses: snok/install-poetry@v1
37 changes: 20 additions & 17 deletions .github/workflows/publish_nightly.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ name: Publish Nightly Builds
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC
- cron: "0 0 * * *" # Run daily at midnight UTC

jobs:
prepare-nightly:
@@ -12,12 +12,12 @@ jobs:
- uses: actions/checkout@v4
with:
ref: main

- name: Configure Git
run: |
git config user.name "GitHub Actions Bot"
git config user.email "actions@github.com"

- name: Update nightly branch
run: |
git checkout -B nightly
@@ -33,20 +33,23 @@ jobs:
- uses: actions/checkout@v4
with:
ref: nightly

- uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
cache: "npm"
cache-dependency-path: ./typescript

- name: Install jq
run: sudo apt-get install jq

- name: Install dependencies and build packages
run: |
cd typescript
npm ci
npm run build

- name: Find NPM packages
id: find-npm-packages
run: |
@@ -56,7 +59,7 @@ jobs:
-not -path "*/examples/*" \
-exec dirname {} \; | tr '\n' ' ')
echo "packages=$PACKAGES" >> $GITHUB_OUTPUT

- name: Update NPM package versions
run: |
for pkg in ${{ steps.find-npm-packages.outputs.packages }}; do
@@ -97,25 +100,25 @@ jobs:
- uses: actions/checkout@v4
with:
ref: nightly

- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"

- name: Install jq
run: sudo apt-get install jq

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Find Python packages
id: find-python-packages
run: |
PACKAGES=$(find . -name "pyproject.toml" \
-not -path "*/examples/*" \
-exec dirname {} \; | tr '\n' ' ')
echo "packages=$PACKAGES" >> $GITHUB_OUTPUT

- name: Update Python package versions
run: |
for pkg in ${{ steps.find-python-packages.outputs.packages }}; do
@@ -149,7 +152,7 @@ jobs:
cd - > /dev/null
fi
done

- name: Build and publish
run: |
for pkg in ${{ steps.find-python-packages.outputs.packages }}; do
@@ -173,18 +176,18 @@ jobs:
- uses: actions/checkout@v4
with:
ref: nightly

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Generate Release Notes
id: release_notes
run: |
TODAY=$(date +%Y%m%d)
TODAY_FORMATTED=$(date +%Y-%m-%d)
echo "TODAY=$TODAY" >> $GITHUB_OUTPUT
echo "TODAY_FORMATTED=$TODAY_FORMATTED" >> $GITHUB_OUTPUT

{
extract_unreleased() {
local file=$1 package=$2 version=$3
@@ -203,7 +206,7 @@ jobs:
fi
}

for pkg in $(find . -name "package.json" -not -path "*/node_modules/*" -not -path "./package.json" -not -path "*/examples/*" -exec dirname {} \;); do
for pkg in $(find . -name "package.json" -not -path "*/node_modules/*" -not -path "./typescript/package.json" -not -path "*/examples/*" -exec dirname {} \;); do
if [ -f "$pkg/package.json" ] && ! grep -q '"private": true' "$pkg/package.json"; then
PKG_NAME=$(node -p "require('$pkg/package.json').name")
CHANGELOG="$pkg/CHANGELOG.md"
@@ -224,7 +227,7 @@ jobs:
done

} > release_notes.md

echo "RELEASE_NOTES<<EOF" >> $GITHUB_OUTPUT
cat release_notes.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
3 changes: 2 additions & 1 deletion .github/workflows/publish_npm_agentkit.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,8 @@ jobs:
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
- run: npm ci
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm ci is ran in the following step

cache: "npm"
cache-dependency-path: ./typescript
- name: Install, build and publish @coinbase/agentkit
working-directory: ./typescript/agentkit
run: |
5 changes: 4 additions & 1 deletion .github/workflows/publish_npm_agentkit_langchain.yml
Original file line number Diff line number Diff line change
@@ -15,10 +15,13 @@ jobs:
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
- run: npm i && npm run build
cache: "npm"
cache-dependency-path: ./typescript
- name: Install, build and publish @coinbase/agentkit-langchain
working-directory: ./typescript/framework-extensions/langchain
run: |
npm ci
npm run build
npm publish --ignore-scripts --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/publish_npm_create_onchain_agent.yml
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@ jobs:
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
cache: "npm"
cache-dependency-path: ./typescript
- name: Install, build and publish create-onchain-agent
working-directory: ./typescript/create-onchain-agent
run: |
84 changes: 5 additions & 79 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ jobs:
working-directory: ./python/coinbase-agentkit
strategy:
matrix:
python: ['3.10', '3.11', '3.12']
python: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3

@@ -40,82 +40,6 @@ jobs:
- name: Run tests
run: poetry run make test

# test-cdp-langchain-python:
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: ./python/cdp-langchain
# strategy:
# matrix:
# python: ['3.10', '3.11', '3.12']

# steps:
# - uses: actions/checkout@v3

# - name: Set up Python ${{ matrix.python }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python }}

# - name: Install Poetry
# uses: snok/install-poetry@v1
# with:
# version: latest
# virtualenvs-create: true
# virtualenvs-in-project: true

# - name: Load cached venv
# id: cached-poetry-dependencies
# uses: actions/cache@v3
# with:
# path: ./python/cdp-langchain/.venv
# key: venv-langchain-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('python/cdp-langchain/poetry.lock') }}

# - name: Install dependencies
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
# run: poetry install --with dev

# - name: Run tests
# run: poetry run make test

# test-twitter-langchain-python:
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: ./python/twitter-langchain
# strategy:
# matrix:
# python: ['3.10', '3.11', '3.12']

# steps:
# - uses: actions/checkout@v3

# - name: Set up Python ${{ matrix.python }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python }}

# - name: Install Poetry
# uses: snok/install-poetry@v1
# with:
# version: latest
# virtualenvs-create: true
# virtualenvs-in-project: true

# - name: Load cached venv
# id: cached-poetry-dependencies
# uses: actions/cache@v3
# with:
# path: ./python/twitter-langchain/.venv
# key: venv-twitter-langchain-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('python/twitter-langchain/poetry.lock') }}

# - name: Install dependencies
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
# run: poetry install --with dev

# - name: Run tests
# run: poetry run make test

test-agentkit-typescript:
runs-on: ubuntu-latest
strategy:
@@ -127,7 +51,9 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: ./typescript
- name: Install and test AgentKit.js
working-directory: ./typescript
run: |
npm i
npm ci
npm run test
Loading
Oops, something went wrong.
Loading
Oops, something went wrong.