Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .czferc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const types = [

const scopes = [
{name: 'chore'},
{name: 'docs'},
{name: 'component'},
{name: 'tools'},
{name: 'types'},
Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/sync-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Sync Docs to arc-docs repo

on:
push:
branches:
- main

env:
DOCS_REPO: sourcefuse/arc-docs
BRANCH_PREFIX: automated-docs-sync/
GITHUB_TOKEN: ${{secrets.ARC_DOCS_API_TOKEN_GITHUB}}
CONFIG_USERNAME: ${{ vars.DOCS_PR_USERNAME }}
CONFIG_EMAIL: ${{ vars.DOCS_PR_EMAIL }}

jobs:
sync-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout Extension Code
uses: actions/checkout@v3
with:
token: ${{env.GITHUB_TOKEN}}
path: './extension/'

- name: Checkout Docs Repository
uses: actions/checkout@v3
with:
token: ${{env.GITHUB_TOKEN}}
repository: ${{env.DOCS_REPO}}
path: './arc-docs/'

- name: Configure GIT
id: configure_git
working-directory: arc-docs
run: |
git config --global user.email $CONFIG_EMAIL
git config --global user.name $CONFIG_USERNAME

extension_branch="${{env.BRANCH_PREFIX}}$(basename $GITHUB_REPOSITORY)"
echo "extension_branch=$extension_branch" >> $GITHUB_OUTPUT

- name: Update Files
id: update_files
working-directory: arc-docs
run: |
extension_branch="${{ steps.configure_git.outputs.extension_branch }}"

# Create a new branch if it doesn't exist, or switch to it if it does
git checkout -B $extension_branch || git checkout $extension_branch

# Copy README from the extension repo
cp ../extension/docs/README.md docs/arc-api-docs/extensions/$(basename $GITHUB_REPOSITORY)/
git add .

if git diff --quiet --cached; then
have_changes="false";
else
have_changes="true";
fi

echo "Have Changes to be commited: $have_changes"
echo "have_changes=$have_changes" >> $GITHUB_OUTPUT

- name: Commit Changes
id: commit
working-directory: arc-docs
if: steps.update_files.outputs.have_changes == 'true'
run: |
git commit -m "sync $(basename $GITHUB_REPOSITORY) docs"
- name: Push Changes
id: push_branch
if: steps.update_files.outputs.have_changes == 'true'
working-directory: arc-docs
run: |
extension_branch="${{ steps.configure_git.outputs.extension_branch }}"
git push https://oauth2:${GITHUB_TOKEN}@github.com/${{env.DOCS_REPO}}.git HEAD:$extension_branch --force

- name: Check PR Status
id: pr_status
if: steps.update_files.outputs.have_changes == 'true'
working-directory: arc-docs
run: |
extension_branch="${{ steps.configure_git.outputs.extension_branch }}"
gh pr status --json headRefName >> "${{github.workspace}}/pr-status.json"
pr_exists="$(jq --arg extension_branch "$extension_branch" '.createdBy[].headRefName == $extension_branch' "${{github.workspace}}/pr-status.json")"
echo "PR Exists: $pr_exists"
echo "pr_exists=$pr_exists" >> $GITHUB_OUTPUT

- name: Create Pull Request
id: create_pull_request
if: steps.pr_status.outputs.pr_exists != 'true' && steps.update_files.outputs.have_changes == 'true'
working-directory: arc-docs
run: |
extension_branch="${{ steps.configure_git.outputs.extension_branch }}"

gh pr create --head $(git branch --show-current) --title "Sync ${{ github.event.repository.name }} Docs" --body "This Pull Request has been created by the 'sync-docs' action within the '${{ github.event.repository.name }}' repository, with the purpose of updating markdown files."
5 changes: 4 additions & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
npx --no-install commitlint --edit
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run test && npm run lint && ./scan-changes.sh
3 changes: 3 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

exec < /dev/tty && npx cz --hook || true
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
# A Loopback4 LLM Chat Extension
<a href="https://sourcefuse.github.io/arc-docs/arc-api-docs" target="_blank"><img src="https://github.com/sourcefuse/loopback4-microservice-catalog/blob/master/docs/assets/logo-dark-bg.png?raw=true" alt="ARC By SourceFuse logo" title="ARC By SourceFuse" align="right" width="150" /></a>

# [A Loopback4 LLM Chat Extension](https://github.com/sourcefuse/loopback4-llm-chat-extension)

<p align="left">
<a href="https://www.npmjs.com/package/lb4-llm-chat-component">
<img src="https://img.shields.io/npm/v/lb4-llm-chat-component.svg" alt="npm version" />
</a>
<a href="https://sonarcloud.io/summary/new_code?id=sourcefuse_llm-chat-component" target="_blank">
<img alt="Sonar Quality Gate" src="https://img.shields.io/sonar/quality_gate/sourcefuse_llm-chat-component?server=https%3A%2F%2Fsonarcloud.io">
</a>
<a href="https://github.com/sourcefuse/loopback4-llm-chat-extension/graphs/contributors" target="_blank">
<img alt="GitHub contributors" src="https://img.shields.io/github/contributors/sourcefuse/loopback4-llm-chat-extension?">
</a>
<a href="https://www.npmjs.com/package/loopback4-authentication" target="_blank">
<img alt="downloads" src="https://img.shields.io/npm/dw/loopback4-llm-chat-extension.svg">
</a>
<a href="https://github.com/sourcefuse/loopback4-llm-chat-extension/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/sourcefuse/loopback4-llm-chat-extension.svg" alt="License" />
</a>
<a href="https://loopback.io/" target="_blank">
<img alt="Powered By LoopBack 4" src="https://img.shields.io/badge/Powered%20by-LoopBack 4-brightgreen" />
</a>
</p>

### Overview

A Loopack4 based component to integrate a basic Langgraph.js based endpoint in your application which can use any tool that you register using the provided decorator.

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
"prune": "npm prune --production",
"coverage": "nyc npm run test",
"migrate:pg:up": "db-migrate up --config migrations/pg/database.json --migrations-dir migrations/pg/migrations",
"migrate:pg:down": "db-migrate down --config migrations/pg/database.json --migrations-dir migrations/pg/migrations"
"migrate:pg:down": "db-migrate down --config migrations/pg/database.json --migrations-dir migrations/pg/migrations",
"prepare": "husky install"
},
"repository": {
"type": "git",
Expand Down