Skip to content

Commit 54db886

Browse files
deepentropyclaude
andcommitted
Fix CJS require() returning empty namespace (#89)
Rename CJS bundles to .cjs so Node parses them as CommonJS instead of treating them as ESM under "type": "module". Bump version to 0.2.8. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 4fc920c commit 54db886

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
22
"name": "oakscriptjs",
3-
"version": "0.2.7",
3+
"version": "0.2.8",
44
"type": "module",
55
"description": "PineScript v6 compatible technical analysis library for JavaScript/TypeScript",
6-
"main": "dist/index.js",
6+
"main": "dist/index.cjs",
77
"module": "dist/index.mjs",
88
"types": "dist/index.d.ts",
99
"exports": {
1010
".": {
1111
"types": "./dist/index.d.ts",
1212
"import": "./dist/index.mjs",
13-
"require": "./dist/index.js"
13+
"require": "./dist/index.cjs"
1414
},
1515
"./runtime": {
1616
"types": "./dist/runtime/index.d.ts",
1717
"import": "./dist/runtime/index.mjs",
18-
"require": "./dist/runtime/index.js"
18+
"require": "./dist/runtime/index.cjs"
1919
}
2020
},
2121
"files": [
@@ -27,9 +27,9 @@
2727
"prepublishOnly": "npm run build",
2828
"build": "npm run clean && npm run build:esm && npm run build:cjs && npm run build:runtime:esm && npm run build:runtime:cjs && npm run build:types",
2929
"build:esm": "esbuild src/index.ts --bundle --format=esm --outfile=dist/index.mjs --platform=neutral --external:@types/* --external:lightweight-charts",
30-
"build:cjs": "esbuild src/index.ts --bundle --format=cjs --outfile=dist/index.js --platform=neutral --external:@types/* --external:lightweight-charts",
30+
"build:cjs": "esbuild src/index.ts --bundle --format=cjs --outfile=dist/index.cjs --platform=neutral --external:@types/* --external:lightweight-charts",
3131
"build:runtime:esm": "esbuild src/runtime/index.ts --bundle --format=esm --outfile=dist/runtime/index.mjs --platform=neutral --external:@types/* --external:lightweight-charts",
32-
"build:runtime:cjs": "esbuild src/runtime/index.ts --bundle --format=cjs --outfile=dist/runtime/index.js --platform=neutral --external:@types/* --external:lightweight-charts",
32+
"build:runtime:cjs": "esbuild src/runtime/index.ts --bundle --format=cjs --outfile=dist/runtime/index.cjs --platform=neutral --external:@types/* --external:lightweight-charts",
3333
"build:types": "tsc --emitDeclarationOnly --outDir dist",
3434
"clean": "rimraf dist",
3535
"dev": "tsc --watch",

0 commit comments

Comments
 (0)