Skip to content

Commit 0f24200

Browse files
committed
Remove CommonJS support
It is getting too hard to maintain both with the varied different runtime environments with compatibility dates and flags.
1 parent 5e008a8 commit 0f24200

File tree

8 files changed

+664
-26
lines changed

8 files changed

+664
-26
lines changed

.changeset/early-mugs-shave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@microlabs/otel-cf-workers': minor
3+
---
4+
5+
Remove CommonJS support

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ npm install @microlabs/otel-cf-workers @opentelemetry/api
1111
> [!IMPORTANT]
1212
> To be able to use the Open Telemetry library you have to add the NodeJS compatibility flag in your `wrangler.toml` file.
1313
14-
```
14+
```json
1515
compatibility_flags = [ "nodejs_compat" ]
1616
```
1717

18+
> [!IMPORTANT]
19+
> As of version 1.0.0-rc.52, we are no longer providing a CommonJS build. It is already hard enough trying to write a library that deals with all of Cloudflare's functionality over every single combination of compatibility flags and dates. Combining that with two different build is just too much. If you really need CommonJS support, please create a ticket (if there isn't already) and describe your use-case.
20+
1821
For a simple setup example with configuration examples, have a look at the [Quickstart Example](https://github.com/evanderkoogh/otel-cf-workers/tree/main/examples/worker)
1922

2023
### Code example

package.json

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
{
22
"name": "@microlabs/otel-cf-workers",
33
"version": "1.0.0-rc.49",
4-
"main": "dist/index.js",
5-
"module": "dist/index.mjs",
6-
"types": "dist/index.d.mts",
7-
"exports": {
8-
".": {
9-
"import": {
10-
"types": "./dist/index.d.mts",
11-
"default": "./dist/index.mjs"
12-
},
13-
"require": {
14-
"types": "./dist/index.d.ts",
15-
"default": "./dist/index.js"
16-
}
17-
}
18-
},
4+
"module": "./dist/index.js",
5+
"type": "module",
6+
"types": "./dist/index.d.ts",
7+
"exports": "./dist/index.js",
198
"scripts": {
209
"clean": "rimraf ./dist versions.json",
2110
"format": "prettier --ignore-unknown --write .",
@@ -49,6 +38,7 @@
4938
},
5039
"devDependencies": {
5140
"@changesets/cli": "^2.29.3",
41+
"@cloudflare/vitest-pool-workers": "^0.8.30",
5242
"@cloudflare/workers-types": "^4.20250510.0",
5343
"husky": "^9.1.7",
5444
"lint-staged": "^15.5.2",

0 commit comments

Comments
 (0)