Skip to content

Commit 42ba6ca

Browse files
authoredMay 28, 2024··
Fix @google/generative-ai/files paths (#156)
1 parent 5c948f7 commit 42ba6ca

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed
 

‎.changeset/calm-otters-confess.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@google/generative-ai": patch
3+
---
4+
5+
Fix paths to @google/generative-ai/files.

‎packages/main/api-extractor.files.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "../../config/api-extractor.json",
3-
"mainEntryPointFilePath": "<projectFolder>/dist/files/src/files/index.d.ts",
3+
"mainEntryPointFilePath": "<projectFolder>/dist/src/files/index.d.ts",
44
"dtsRollup": {
55
"enabled": true,
66
"untrimmedFilePath": "<projectFolder>/dist/files/files.d.ts"

‎packages/main/files/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "@google/generative-ai/files",
2+
"name": "@google/generative-ai-files",
33
"description": "GoogleAI file upload manager",
4-
"main": "./dist/files/index.js",
5-
"browser": "./dist/files/index.mjs",
6-
"module": "./dist/files/index.mjs",
7-
"typings": "./dist/files/files.d.ts"
4+
"main": "../dist/files/index.js",
5+
"browser": "../dist/files/index.mjs",
6+
"module": "../dist/files/index.mjs",
7+
"typings": "../dist/files/files.d.ts"
88
}

‎packages/main/rollup.config.mjs

+6-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import typescriptPlugin from "rollup-plugin-typescript2";
2020
import typescript from "typescript";
2121
import json from "@rollup/plugin-json";
2222
import pkg from "./package.json" assert { type: "json" };
23-
import filePkg from "./files/package.json" assert { type: "json" };
2423

2524
const es2017BuildPlugins = [
2625
typescriptPlugin({
@@ -65,13 +64,17 @@ const cjsBuilds = [
6564
const filesBuilds = [
6665
{
6766
input: "src/files/index.ts",
68-
output: [{ file: filePkg.module, format: "es", sourcemap: true }],
67+
output: [
68+
{ file: pkg.exports["./files"].import, format: "es", sourcemap: true },
69+
],
6970
external: ["fs"],
7071
plugins: [...es2017BuildPlugins],
7172
},
7273
{
7374
input: "src/files/index.ts",
74-
output: [{ file: filePkg.main, format: "cjs", sourcemap: true }],
75+
output: [
76+
{ file: pkg.exports["./files"].require, format: "cjs", sourcemap: true },
77+
],
7578
external: ["fs"],
7679
plugins: [...es2017BuildPlugins],
7780
},

0 commit comments

Comments
 (0)
Please sign in to comment.