Skip to content

Commit 304d408

Browse files
committed
Fix the build
1 parent 4748d75 commit 304d408

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

packages/types/package.json

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
{
22
"name": "@roo-code/types",
3-
"version": "1.15.0",
3+
"version": "1.16.0",
44
"description": "TypeScript type definitions for Roo Code.",
55
"publishConfig": {
6-
"access": "public"
6+
"access": "public",
7+
"main": "./dist/index.cjs",
8+
"module": "./dist/index.mjs",
9+
"types": "./dist/index.d.ts",
10+
"exports": {
11+
".": {
12+
"types": "./dist/index.d.ts",
13+
"import": "./dist/index.mjs",
14+
"require": "./dist/index.cjs"
15+
}
16+
}
717
},
818
"author": "Roo Code Team",
919
"license": "MIT",
@@ -20,16 +30,14 @@
2030
"roo-code",
2131
"ai"
2232
],
23-
"main": "./dist/index.js",
24-
"module": "./dist/index.mjs",
25-
"types": "./dist/index.d.ts",
33+
"main": "./dist/index.cjs",
2634
"exports": {
2735
".": {
28-
"types": "./dist/index.d.ts",
29-
"import": "./dist/index.mjs",
36+
"types": "./src/index.ts",
37+
"import": "./src/index.ts",
3038
"require": {
3139
"types": "./dist/index.d.ts",
32-
"default": "./dist/index.js"
40+
"default": "./dist/index.cjs"
3341
}
3442
}
3543
},

packages/types/src/__tests__/cjs-import.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { resolve } from "path"
44

55
describe("CommonJS Import Tests", () => {
66
const packageRoot = resolve(__dirname, "../..")
7-
const cjsPath = resolve(packageRoot, "dist", "index.js")
7+
const cjsPath = resolve(packageRoot, "dist", "index.cjs")
88

99
it("should import types using require() syntax", () => {
1010
// Clear require cache to ensure fresh import.

packages/types/src/__tests__/package-exports.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe("Package Exports Integration Tests", () => {
1818
})
1919

2020
it("should import from built CJS file", () => {
21-
const cjsPath = resolve(distPath, "index.js")
21+
const cjsPath = resolve(distPath, "index.cjs")
2222

2323
// Clear require cache to ensure fresh import
2424
delete require.cache[cjsPath]
@@ -34,7 +34,7 @@ describe("Package Exports Integration Tests", () => {
3434

3535
it("should have consistent exports between ESM and CJS builds", async () => {
3636
const esmPath = resolve(distPath, "index.mjs")
37-
const cjsPath = resolve(distPath, "index.js")
37+
const cjsPath = resolve(distPath, "index.cjs")
3838

3939
// Clear require cache.
4040
delete require.cache[cjsPath]

packages/types/tsup.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@ export default defineConfig({
88
splitting: false,
99
sourcemap: true,
1010
outDir: "dist",
11+
outExtension({ format }) {
12+
return {
13+
js: format === "cjs" ? ".cjs" : ".mjs",
14+
dts: format === "cjs" ? ".d.cts" : ".d.mts",
15+
}
16+
},
1117
})

0 commit comments

Comments
 (0)