Skip to content

Commit 76aa5b2

Browse files
Merge pull request #36 from bendtherules/fix/bundle-plugin-for-server-mode
2 parents 8d22eb2 + bd7a4f9 commit 76aa5b2

2 files changed

Lines changed: 27 additions & 5 deletions

File tree

package.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,17 @@
2929
"eslint-plugin-jsdoc": "^50.6.11"
3030
},
3131
"exports": {
32-
".": "./src/index.ts"
32+
".": {
33+
"types": "./dist/index.d.ts",
34+
"default": "./dist/index.js"
35+
},
36+
"./server": {
37+
"types": "./dist/index.d.ts",
38+
"default": "./dist/index.js"
39+
}
3340
},
3441
"files": [
35-
"src/"
42+
"dist/"
3643
],
3744
"homepage": "https://github.com/DEVtheOPS/opencode-plugin-otel#readme",
3845
"keywords": [
@@ -44,8 +51,9 @@
4451
"observability"
4552
],
4653
"license": "MPL-2.0",
47-
"main": "src/index.ts",
48-
"module": "src/index.ts",
54+
"main": "dist/index.js",
55+
"module": "dist/index.js",
56+
"types": "dist/index.d.ts",
4957
"name": "@devtheops/opencode-plugin-otel",
5058
"oc-plugin": [
5159
"server"
@@ -58,9 +66,11 @@
5866
"url": "https://github.com/DEVtheOPS/opencode-plugin-otel.git"
5967
},
6068
"scripts": {
69+
"build": "bun build src/index.ts --outdir=./dist --target=node && tsc -p tsconfig.build.json",
6170
"check:jsdoc-coverage": "bun scripts/check-jsdoc-coverage.mjs",
6271
"lint": "bun --bun eslint .",
63-
"typecheck": "tsc --noEmit"
72+
"typecheck": "tsc --noEmit",
73+
"prepack": "bun run build"
6474
},
6575
"type": "module",
6676
"version": "0.8.0"

tsconfig.build.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": false,
5+
"declaration": true,
6+
"emitDeclarationOnly": true,
7+
"outDir": "./dist",
8+
"rootDir": "./src"
9+
},
10+
"include": ["src"],
11+
"exclude": ["eslint.config.mjs", "dist", "scripts", "tests"]
12+
}

0 commit comments

Comments
 (0)