Skip to content

Commit c0ae0e0

Browse files
authored
πŸ”§ rewriteRelativeImportExtensions (#59)
* πŸ”§ rewriteRelativeImportExtensions * 🎨 Import from `.ts` * πŸ”§ Update CODEOWNERS for TypeScript files
1 parent 8e3343d commit c0ae0e0

8 files changed

+46
-44
lines changed

β€Ž.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @coderabbitai/typescript-reviewers
1+
*.ts @coderabbitai/typescript-reviewers

β€Ž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/functions.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { describe, test } from "vitest"
2-
import type { FunctionDef, ObjectProp, Prop } from "./functions.js"
2+
import type { FunctionDef, ObjectProp, Prop } from "./functions.ts"
33
import {
44
formatFunctionDefinitions,
55
formatObjectProperties,
66
formatType,
77
isAnyOfProp,
8-
} from "./functions.js"
8+
} from "./functions.ts"
99

1010
describe("isAnyOfProp", () => {
1111
test("true", ({ expect }) => {

β€Ž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)