Skip to content

Commit

Permalink
Fix @google/generative-ai/files paths (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 authored May 28, 2024
1 parent 5c948f7 commit 42ba6ca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-otters-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@google/generative-ai": patch
---

Fix paths to @google/generative-ai/files.
2 changes: 1 addition & 1 deletion packages/main/api-extractor.files.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../../config/api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist/files/src/files/index.d.ts",
"mainEntryPointFilePath": "<projectFolder>/dist/src/files/index.d.ts",
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "<projectFolder>/dist/files/files.d.ts"
Expand Down
10 changes: 5 additions & 5 deletions packages/main/files/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@google/generative-ai/files",
"name": "@google/generative-ai-files",
"description": "GoogleAI file upload manager",
"main": "./dist/files/index.js",
"browser": "./dist/files/index.mjs",
"module": "./dist/files/index.mjs",
"typings": "./dist/files/files.d.ts"
"main": "../dist/files/index.js",
"browser": "../dist/files/index.mjs",
"module": "../dist/files/index.mjs",
"typings": "../dist/files/files.d.ts"
}
9 changes: 6 additions & 3 deletions packages/main/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import typescriptPlugin from "rollup-plugin-typescript2";
import typescript from "typescript";
import json from "@rollup/plugin-json";
import pkg from "./package.json" assert { type: "json" };
import filePkg from "./files/package.json" assert { type: "json" };

const es2017BuildPlugins = [
typescriptPlugin({
Expand Down Expand Up @@ -65,13 +64,17 @@ const cjsBuilds = [
const filesBuilds = [
{
input: "src/files/index.ts",
output: [{ file: filePkg.module, format: "es", sourcemap: true }],
output: [
{ file: pkg.exports["./files"].import, format: "es", sourcemap: true },
],
external: ["fs"],
plugins: [...es2017BuildPlugins],
},
{
input: "src/files/index.ts",
output: [{ file: filePkg.main, format: "cjs", sourcemap: true }],
output: [
{ file: pkg.exports["./files"].require, format: "cjs", sourcemap: true },
],
external: ["fs"],
plugins: [...es2017BuildPlugins],
},
Expand Down

0 comments on commit 42ba6ca

Please sign in to comment.