An open-source, faster Devin alternative
TypeScript
Fix TS SDK ESM imports: use nodenext module resolution with .js extensions
motatoesfc6e39cb8856
diff --git a/sdks/typescript/package.json b/sdks/typescript/package.jsonindex b9a63e24..99a3b986 100644--- a/sdks/typescript/package.json+++ b/sdks/typescript/package.json@@ -1,6 +1,6 @@{"name": "@opencomputer/sdk",- "version": "0.5.6",+ "version": "0.5.7","description": "TypeScript SDK for OpenComputer - cloud sandbox platform","type": "module","main": "dist/index.js",diff --git a/sdks/typescript/src/index.ts b/sdks/typescript/src/index.tsindex 99f955fc..cc7ebe84 100644--- a/sdks/typescript/src/index.ts+++ b/sdks/typescript/src/index.ts@@ -1,5 +1,5 @@-export { Sandbox, type SandboxOpts } from "./sandbox";-export { Filesystem, type EntryInfo } from "./filesystem";-export { Commands, type ProcessResult, type RunOpts } from "./commands";-export { Pty, type PtySession, type PtyOpts } from "./pty";-export { Templates, type TemplateInfo } from "./template";+export { Sandbox, type SandboxOpts } from "./sandbox.js";+export { Filesystem, type EntryInfo } from "./filesystem.js";+export { Commands, type ProcessResult, type RunOpts } from "./commands.js";+export { Pty, type PtySession, type PtyOpts } from "./pty.js";+export { Templates, type TemplateInfo } from "./template.js";diff --git a/sdks/typescript/src/sandbox.ts b/sdks/typescript/src/sandbox.tsindex f123b6a0..5e207f91 100644--- a/sdks/typescript/src/sandbox.ts+++ b/sdks/typescript/src/sandbox.ts@@ -1,6 +1,6 @@-import { Filesystem } from "./filesystem";-import { Commands } from "./commands";-import { Pty } from "./pty";+import { Filesystem } from "./filesystem.js";+import { Commands } from "./commands.js";+import { Pty } from "./pty.js";function resolveApiUrl(url: string): string {const base = url.replace(/\/+$/, "");diff --git a/sdks/typescript/tsconfig.json b/sdks/typescript/tsconfig.jsonindex 35f58b7d..e3c09eea 100644--- a/sdks/typescript/tsconfig.json+++ b/sdks/typescript/tsconfig.json@@ -1,8 +1,8 @@{"compilerOptions": {"target": "ES2022",- "module": "ESNext",- "moduleResolution": "bundler",+ "module": "nodenext",+ "moduleResolution": "nodenext","lib": ["ES2022", "DOM"],"outDir": "dist","rootDir": "src",