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
5 changes: 5 additions & 0 deletions .changeset/tidy-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mynameistito/codex-usage": patch
---

Update dependencies and GitHub Actions to their latest releases.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.2
bun-version: 1.4.3

- name: Install dependencies
run: bun install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: "1.4.2"
bun-version: "1.4.3"

- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.2
bun-version: 1.4.3

- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
package-manager-cache: false
Expand All @@ -43,7 +43,7 @@ jobs:

- name: Create release pull request
id: changesets
uses: changesets/action@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1
uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2
with:
version-script: bunx changeset version
env:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ codex-usage reset --confirm
## Library usage

```ts
import { Effect } from "effect";
import {
createCodexClient,
formatUsage,
readCodexAuth,
} from "@mynameistito/codex-usage";
import { Effect } from "effect";

const program = Effect.gen(function* () {
const tokens = yield* readCodexAuth();
Expand Down
352 changes: 163 additions & 189 deletions bun.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"effect": "4.0.0-rc.117"
"effect": "4.0.2"
},
"devDependencies": {
"@changesets/cli": "^3.0.3",
"@types/bun": "^1.4.2",
"@typescript/native": "npm:typescript@^7.0.2",
"eslint-plugin-github": "6.1.2",
"eslint-plugin-sonarjs": "^4.2.1",
"knip": "^6.37.0",
"lefthook": "^2.1.14",
"oxfmt": "^0.68.0",
"oxlint": "^1.83.0",
"tsdown": "^0.23.0",
"eslint-plugin-sonarjs": "^4.2.2",
"knip": "^6.41.0",
"lefthook": "^2.2.1",
"oxfmt": "^0.72.0",
"oxlint": "^1.87.0",
"tsdown": "^0.23.1",
"typescript": "npm:@typescript/typescript6@^6.0.2",
"ultracite": "7.12.0"
"ultracite": "8.0.0"
},
"packageManager": "bun@1.4.2"
"packageManager": "bun@1.4.3"
}
7 changes: 6 additions & 1 deletion src/codex/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@ const normalizeBaseUrl = (
}

if (CHATGPT_HOSTNAMES.has(parsed.hostname)) {
const pathname = parsed.pathname.replace(/\/+$/u, "") || "/";
const { pathname: parsedPathname } = parsed;
let pathname = parsedPathname;
while (pathname.endsWith("/")) {
pathname = pathname.slice(0, -1);
}
pathname ||= "/";

if (pathname === "/") {
return `${normalized}/backend-api`;
Expand Down
Loading