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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.4/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "reaatech/llm-cache" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
38 changes: 0 additions & 38 deletions .eslintrc.cjs

This file was deleted.

103 changes: 16 additions & 87 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -29,10 +27,7 @@ jobs:
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build workspace
run: pnpm build
run: pnpm install

- name: Lint
run: pnpm lint
Expand All @@ -48,9 +43,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -59,7 +52,7 @@ jobs:
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: pnpm install

- name: Dependency audit
run: pnpm audit --audit-level=high
Expand All @@ -71,6 +64,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: ['20', '22']
package:
- packages/core
- packages/adapters/redis
Expand All @@ -84,21 +78,16 @@ jobs:
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build workspace
run: pnpm build
run: pnpm install

- name: Test ${{ matrix.package }}
run: pnpm --filter ${{ matrix.package }} test
Expand All @@ -112,9 +101,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -123,19 +110,19 @@ jobs:
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: pnpm install

- name: Build workspace
- name: Build packages
run: pnpm build

- name: Run coverage (core)
run: pnpm --filter @llm-cache/core test:coverage
run: pnpm --filter @reaatech/llm-cache test:coverage

- name: Run coverage (cost-tracker)
run: pnpm --filter @llm-cache/cost-tracker test:coverage
run: pnpm --filter @reaatech/llm-cache-cost-tracker test:coverage

- name: Run coverage (observability)
run: pnpm --filter @llm-cache/observability test:coverage
run: pnpm --filter @reaatech/llm-cache-observability test:coverage

build:
name: Build All Packages
Expand All @@ -146,74 +133,16 @@ jobs:
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build all packages
run: pnpm build

deploy-staging:
name: Deploy to Staging
needs: [build, coverage]
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
environment: staging
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
run: echo "Deploy to staging would run here"

deploy-production:
name: Deploy to Production
needs: [build, coverage]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
run: echo "Deploy to production would run here"

publish:
name: Publish to npm
needs: [build, coverage]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: pnpm install

- name: Build all packages
run: pnpm build

- name: Publish packages
run: pnpm -r publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
82 changes: 82 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Release

on:
workflow_dispatch:
# push:
# branches: [main]
# Uncomment the push trigger AFTER first publish succeeds (see GITHUB_TO_NPM.md section 7)

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

env:
NODE_VERSION: 20

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install

- name: Build packages
run: pnpm build

- name: Create release PR or publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
version: pnpm version-packages
commit: 'chore(release): version packages'
title: 'chore(release): version packages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: 'true'

- name: Mirror published packages to GitHub Packages
if: steps.changesets.outputs.published == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
run: |
cat > .npmrc <<EOF
@reaatech:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
EOF
echo "$PUBLISHED_PACKAGES" | jq -r '.[].name' | while read -r name; do
dir="packages/${name#@reaatech/llm-cache-}"
# Handle core: @reaatech/llm-cache → packages/core
if [ "$name" = "@reaatech/llm-cache" ]; then
dir="packages/core"
fi
# Handle server: @reaatech/llm-cache-server → packages/server
if [ "$name" = "@reaatech/llm-cache-server" ]; then
dir="packages/server"
fi
echo "Mirroring $name -> $dir"
(cd "$dir" && npm publish --registry=https://npm.pkg.github.com)
done
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Thumbs.db

# Logs
logs/

# Stray build output in src/ (prevents tsup confusion and tarball bloat)
packages/*/src/**/*.js
packages/*/src/**/*.js.map
packages/*/src/**/*.d.ts
packages/*/src/**/*.d.ts.map
*.log
npm-debug.log*
pnpm-debug.log*
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=false
strict-peer-dependencies=true
8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

Loading
Loading