Skip to content

Commit 2bd410a

Browse files
committed
🔧 rewriteRelativeImportExtensions
1 parent 8e3343d commit 2bd410a

File tree

6 files changed

+43
-41
lines changed

6 files changed

+43
-41
lines changed

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"openai": "^4.56.0",
3131
"prettier": "^3.3.3",
3232
"typedoc": "^0.26.6",
33-
"typescript": "^5.5.4",
33+
"typescript": "5.7.0-beta",
3434
"typescript-eslint": "^8.2.0",
3535
"vite": "^5.4.2",
3636
"vitest": "^2.0.5"

‎pnpm-lock.yaml

+35-35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from "./functions.js"
2-
export * from "./token-counts.js"
1+
export * from "./functions.ts"
2+
export * from "./token-counts.ts"

‎src/token-counts.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import OpenAI from "openai"
22
import { loadEnv } from "vite"
33
import { describe, test } from "vitest"
4-
import { promptTokensEstimate, type Prompt } from "./token-counts.js"
4+
import type { Prompt } from "./token-counts.ts"
5+
import { promptTokensEstimate } from "./token-counts.ts"
56

67
const mode = process.env["NODE_ENV"] ?? "development"
78
Object.assign(process.env, loadEnv(mode, process.cwd(), ""))

‎src/token-counts.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { Tiktoken } from "js-tiktoken"
22
import { getEncoding } from "js-tiktoken"
33
import type OpenAI from "openai"
4-
import type { FunctionDef } from "./functions.js"
5-
import { formatFunctionDefinitions } from "./functions.js"
4+
import type { FunctionDef } from "./functions.ts"
5+
import { formatFunctionDefinitions } from "./functions.ts"
66

77
type Message = OpenAI.Chat.ChatCompletionMessageParam
88
type OpenAIFunction = OpenAI.Chat.ChatCompletionCreateParams.Function

‎tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"rootDir": "./src",
1616
"moduleResolution": "NodeNext",
1717
"typeRoots": ["./node_modules/@types", "./src/types"],
18+
"rewriteRelativeImportExtensions": true,
1819
"resolvePackageJsonExports": true,
1920
"resolvePackageJsonImports": true,
2021
"resolveJsonModule": true,

0 commit comments

Comments
 (0)