Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hmarr/openai-chat-tokens
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: coderabbitai/openai-chat-tokens
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm-lock.yaml linguist-generated
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.ts @coderabbitai/typescript-reviewers
45 changes: 45 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: monthly
timezone: America/Toronto
commit-message:
prefix: "⬆️ "
groups:
patch-development:
dependency-type: development
update-types:
- patch
patch-production:
dependency-type: production
update-types:
- patch

eslint:
patterns:
- "*eslint*"
prettier:
patterns:
- "*prettier*"
openai:
patterns:
- "*openai*"
- "*tiktoken*"
vite:
patterns:
- vite
- vitest
typescript:
patterns:
- "*typescript*"
- tslib

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
timezone: America/Toronto
commit-message:
prefix: "⬆️ "
20 changes: 0 additions & 20 deletions .github/workflows/ci.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/github-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: GitHub Pages

on:
push:
branches: main

jobs:
build_pages:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: 23
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run docs
- uses: actions/upload-pages-artifact@v3
with:
path: docs

deploy_pages:
needs: build_pages

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- id: deployment
uses: actions/deploy-pages@v4
92 changes: 92 additions & 0 deletions .github/workflows/node.js.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Node.js CI

on:
merge_group:
branches:
- main
pull_request:
branches:
- main
push:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: 23
cache: pnpm
- run: pnpm install --frozen-lockfile --strict-peer-dependencies
- run: pnpm run build --noEmit
- run: pnpm run lint
- run: pnpm run test

fix:
runs-on: ubuntu-latest

permissions:
contents: write

needs:
- test

if: failure() && github.event_name != 'merge_group' && github.actor != 'github-actions[bot]' && github.actor != 'nektos/act'

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: 23

- run: |
pnpm install --fix-lockfile --no-frozen-lockfile
git add .
- id: commit-lockfile
uses: qoomon/actions--create-commit@v1
with:
message: |
📌 pnpm install --fix-lockfile
[dependabot skip]
skip-empty: true

- run: |
pnpm run format
git add .
- id: commit-format
uses: qoomon/actions--create-commit@v1
with:
message: |
🎨 pnpm run format
[dependabot skip]
skip-empty: true

- run: |
pnpm run lint:fix
git add .
- id: commit-lint
uses: qoomon/actions--create-commit@v1
with:
message: |
🚨 pnpm run lint:fix
[dependabot skip]
skip-empty: true

- if: steps.commit-lockfile.outputs.commit || steps.commit-format.outputs.commit || steps.commit-lint.outputs.commit
run: git push
48 changes: 48 additions & 0 deletions .github/workflows/pnpm-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Node.js Publish

on:
push:
tags:
- v*

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write
packages: write

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: 23
- run: pnpm install
- run: pnpm build

- uses: actions/setup-node@v4
with:
registry-url: https://npm.pkg.github.com
scope: "@coderabbitai"
- run: pnpm publish --access public --no-git-checks --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org
scope: "@coderabbitai"
- run: pnpm publish --access public --no-git-checks --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.CODERABBIT_NPMTOKEN }}

- run: pnpm pack --pack-gzip-level 9
- run: gh release upload ${{ github.ref_name }} coderabbitai-openai-chat-tokens-*.tgz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/pnpm-version-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Node.js Patch

on: workflow_dispatch

jobs:
patch:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: 23

- id: patch
run: |
echo "VERSION=$(pnpm version patch --no-git-tag-version)" >> "$GITHUB_OUTPUT"
git add .
- id: commit
uses: qoomon/actions--create-commit@v1
with:
message: 🔖 ${{ steps.patch.outputs.VERSION }}

- run: |
git push
gh release create "$VERSION" --generate-notes --target "$COMMIT" --title "$VERSION"
env:
COMMIT: ${{ steps.commit.outputs.commit }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.patch.outputs.VERSION }}
21 changes: 0 additions & 21 deletions .github/workflows/publish.yml

This file was deleted.

Loading