-
Notifications
You must be signed in to change notification settings - Fork 171
chore: Add commonjs builds to openinference-genai #2505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@arizeai/openinference-genai": patch | ||
| --- | ||
|
|
||
| feat: Add commonjs builds to openinference-genai |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,28 +2,33 @@ | |
| "name": "@arizeai/openinference-genai", | ||
| "version": "0.1.0", | ||
| "private": false, | ||
| "type": "module", | ||
| "types": "dist/esm/index.d.ts", | ||
| "main": "dist/src/index.js", | ||
| "module": "dist/esm/index.js", | ||
| "types": "dist/src/index.d.ts", | ||
| "description": "OpenInference utilities for converting OpenTelemetry GenAI span attributes to OpenInference span attributes", | ||
| "scripts": { | ||
| "prebuild": "rimraf dist", | ||
| "build": "tsc --build tsconfig.esm.json && tsc-alias -p tsconfig.esm.json", | ||
| "build": "tsc --build tsconfig.commonjs.json tsconfig.esm.json && tsc-alias -p tsconfig.esm.json", | ||
| "postbuild": "echo '{\"type\": \"module\"}' > ./dist/esm/package.json && rimraf dist/test dist/examples", | ||
| "type:check": "tsc --noEmit", | ||
| "test": "vitest" | ||
| }, | ||
| "exports": { | ||
| ".": { | ||
| "import": "./dist/esm/index.js" | ||
| "import": "./dist/esm/index.js", | ||
| "require": "./dist/commonjs/index.js" | ||
| }, | ||
| "./attributes": { | ||
| "import": "./dist/esm/attributes.js" | ||
| "import": "./dist/esm/attributes.js", | ||
| "require": "./dist/commonjs/attributes.js" | ||
| }, | ||
| "./utils": { | ||
| "import": "./dist/esm/utils.js" | ||
| "import": "./dist/esm/utils.js", | ||
| "require": "./dist/commonjs/utils.js" | ||
| }, | ||
| "./types": { | ||
| "types": "./dist/esm/types.d.ts" | ||
| "types": "./dist/esm/types.d.ts", | ||
| "require": "./dist/commonjs/types.d.ts" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Require condition points to type definition file instead of JavaScriptThe |
||
| } | ||
| }, | ||
| "files": [ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "extends": "../../tsconfig.base.json", | ||
| "compilerOptions": { | ||
| "outDir": "dist/commonjs", | ||
| "rootDir": "src", | ||
| "module": "NodeNext", | ||
| "moduleResolution": "NodeNext", | ||
| "tsBuildInfoFile": "dist/commonjs/tsconfig.commonjs.tsbuildinfo", | ||
| "noEmit": false | ||
| }, | ||
| "include": ["src/**/*.ts"], | ||
| "references": [] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Main and types fields point to non-existent paths
The
mainandtypesfields point todist/src/index.jsanddist/src/index.d.ts, but the build script only generates output todist/commonjs/anddist/esm/directories. Thetsconfig.commonjs.jsonhasoutDir: "dist/commonjs"withrootDir: "src", so files compile todist/commonjs/index.js. Thedist/src/directory will never be created, causing Node.js to fail to resolve the package when these fallback fields are used.