Skip to content

Commit ba57e06

Browse files
committed
bundle redis-worker
1 parent 05214e8 commit ba57e06

File tree

3 files changed

+654
-50
lines changed

3 files changed

+654
-50
lines changed

packages/redis-worker/package.json

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,14 @@
1515
"files": [
1616
"dist"
1717
],
18-
"tshy": {
19-
"selfLink": false,
20-
"module": true,
21-
"project": "./tsconfig.src.json",
22-
"dialects": [
23-
"esm"
24-
],
25-
"exports": {
26-
"./package.json": "./package.json",
27-
".": "./src/index.ts"
28-
},
29-
"sourceDialects": [
30-
"@triggerdotdev/source"
31-
]
32-
},
3318
"scripts": {
34-
"clean": "rimraf dist .tshy .tshy-build .turbo",
35-
"build": "tshy",
36-
"dev": "tshy --watch",
19+
"clean": "rimraf dist .turbo",
20+
"build": "tsup",
21+
"dev": "tsup --watch",
3722
"typecheck": "tsc --noEmit -p tsconfig.src.json",
3823
"test": "vitest --sequence.concurrent=false --no-file-parallelism"
3924
},
4025
"dependencies": {
41-
"@internal/redis": "workspace:*",
42-
"@internal/tracing": "workspace:*",
4326
"@trigger.dev/core": "workspace:*",
4427
"lodash.omit": "^4.5.0",
4528
"nanoid": "^5.0.7",
@@ -48,25 +31,26 @@
4831
"zod": "3.23.8"
4932
},
5033
"devDependencies": {
34+
"@internal/redis": "workspace:*",
5135
"@internal/testcontainers": "workspace:*",
36+
"@internal/tracing": "workspace:*",
5237
"@types/lodash.omit": "^4.5.7",
5338
"rimraf": "6.0.1",
54-
"tshy": "^3.0.2",
39+
"tsup": "^8.4.0",
5540
"tsx": "4.17.0",
5641
"vitest": "^1.4.0"
5742
},
5843
"engines": {
5944
"node": ">=18.20.0"
6045
},
46+
"main": "./dist/index.cjs",
47+
"module": "./dist/index.js",
48+
"types": "./dist/index.d.ts",
6149
"exports": {
62-
"./package.json": "./package.json",
6350
".": {
64-
"import": {
65-
"@triggerdotdev/source": "./src/index.ts",
66-
"types": "./dist/esm/index.d.ts",
67-
"default": "./dist/esm/index.js"
68-
}
51+
"types": "./dist/index.d.ts",
52+
"import": "./dist/index.js",
53+
"require": "./dist/index.cjs"
6954
}
70-
},
71-
"module": "./dist/esm/index.js"
55+
}
7256
}

packages/redis-worker/tsup.config.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { defineConfig } from "tsup";
2+
3+
export default defineConfig({
4+
entry: ["src/index.ts"],
5+
format: ["cjs", "esm"],
6+
dts: true,
7+
splitting: false,
8+
sourcemap: true,
9+
clean: true,
10+
treeshake: true,
11+
bundle: true,
12+
minify: false,
13+
noExternal: [
14+
// Always bundle internal packages
15+
/^@internal/,
16+
// Always bundle ESM-only packages
17+
"nanoid",
18+
"p-limit",
19+
],
20+
banner: ({ format }) => {
21+
if (format !== "esm") return;
22+
23+
return {
24+
js: `import { createRequire } from 'module'; const require = createRequire(import.meta.url);`,
25+
};
26+
},
27+
});

0 commit comments

Comments
 (0)