diff --git a/packages/cli/package.json b/packages/cli/package.json index cee9d6e9a1..7eee652af0 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -10,14 +10,14 @@ ".": "./built/genaiscript.cjs", "./api": "./built/api.mjs", "./runtime": { - "import": "./built/runtime.js", - "types": "./built/runtime.d.ts" + "types": "./built/runtime.d.ts", + "import": "./built/runtime.mjs" }, "./package.json": "./package.json" }, "files": [ "built/api.mjs", - "built/runtime.js", + "built/runtime.mjs", "built/runtime.d.ts", "built/genaiscript.cjs" ], @@ -111,7 +111,7 @@ "zx": "^8.2.4" }, "scripts": { - "compile:runtime": "tsc src/runtime.ts --skipLibCheck --outDir built --declaration --module es6 --moduleResolution node", + "compile:runtime": "tsc src/runtime.ts --skipLibCheck --outDir built --declaration --target es2020 --moduleResolution node && mv built/runtime.js built/runtime.mjs", "compile:api": "esbuild src/api.ts --outfile=built/api.mjs", "compile": "yarn compile:api && yarn compile:runtime && esbuild src/main.ts --metafile=./esbuild.meta.json --bundle --platform=node --target=node20 --outfile=built/genaiscript.cjs --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:dockerode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:promptfoo --external:typescript --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:mammoth --external:xlsx --external:mathjs --external:@azure/identity --external:gpt-tokenizer --external:playwright --external:@inquirer/prompts --external:jimp --external:turndown --external:turndown-plugin-gfm --external:vectra --external:tabletojson --external:html-to-text --external:@octokit/rest --external:@octokit/plugin-throttling --external:@octokit/plugin-retry --external:@octokit/plugin-paginate-rest --external:skia-canvas --external:@huggingface/transformers --external:@modelcontextprotocol/sdk --external:@anthropic-ai/sdk --external:es-toolkit && node ../../scripts/patch-cli.mjs", "compile-debug": "esbuild src/main.ts --sourcemap --metafile=./esbuild.meta.json --bundle --platform=node --target=node20 --outfile=built/genaiscript.cjs --external:tsx --external:esbuild --external:get-tsconfig --external:resolve-pkg-maps --external:dockerode --external:pdfjs-dist --external:web-tree-sitter --external:tree-sitter-wasms --external:promptfoo --external:typescript --external:@lvce-editor/ripgrep --external:gpt-3-encoder --external:mammoth --external:xlsx --external:mathjs --external:@azure/identity --external:gpt-tokenizer --external:playwright --external:@inquirer/prompts --external:jimp --external:turndown --external:turndown-plugin-gfm --external:vectra --external:tabletojson --external:html-to-text --external:@octokit/rest --external:@octokit/plugin-throttling --external:@octokit/plugin-retry --external:@octokit/plugin-paginate-rest --external:skia-canvas --external:@huggingface/transformers --external:@modelcontextprotocol/sdk --external:@anthropic-ai/sdk --external:es-toolkit",