Skip to content

Commit 755242f

Browse files
Uzlopakwolfy1339
andauthored
chore!: esm only (#306)
BREAKING CHANGE: This package has now migrated to ESM only Co-authored-by: wolfy1339 <[email protected]>
1 parent 7f31743 commit 755242f

File tree

7 files changed

+42
-66
lines changed

7 files changed

+42
-66
lines changed

.github/workflows/ci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ jobs:
9494
node-version:
9595
- 18
9696
- 20
97-
- 21
9897
- 22
9998
os:
10099
- ubuntu-latest

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Run `smee --help` for usage.
2727
### Node Client
2828

2929
```js
30-
const SmeeClient = require('smee-client')
30+
import SmeeClient from 'smee-client'
3131

3232
const smee = new SmeeClient({
3333
source: 'https://smee.io/abc123',

index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import validator from "validator";
2-
import EventSource from "eventsource";
2+
import { EventSource } from "undici";
33
import url from "url";
44
import querystring from "querystring";
55

@@ -111,4 +111,4 @@ class Client {
111111
}
112112
}
113113

114-
export = Client;
114+
export default Client;

package-lock.json

+32-57
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.0-development",
44
"description": "Client to proxy webhooks to localhost",
55
"main": "index.js",
6+
"type": "module",
67
"bin": {
78
"smee": "./bin/smee.js"
89
},
@@ -24,13 +25,12 @@
2425
"license": "ISC",
2526
"dependencies": {
2627
"commander": "^12.0.0",
27-
"eventsource": "^2.0.2",
28+
"undici": "6.19.8",
2829
"validator": "^13.11.0"
2930
},
3031
"devDependencies": {
3132
"@octokit/tsconfig": "^3.0.0",
32-
"@types/eventsource": "^1.1.15",
33-
"@types/node": "^20.0.0",
33+
"@types/node": "^18.19.14",
3434
"@types/validator": "^13.11.6",
3535
"@vitest/coverage-v8": "^2.0.0",
3636
"fastify": "^4.24.3",

test/index.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Client from "../index";
1+
import Client from "../index.ts";
22
import { describe, test, expect } from "vitest";
33
import { fastify as Fastify } from "fastify";
44

tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "@octokit/tsconfig",
33

44
"compilerOptions": {
5+
"module": "ES2020",
56
"verbatimModuleSyntax": false,
67
"noImplicitReturns": true,
78
"noFallthroughCasesInSwitch": true,
@@ -13,7 +14,8 @@
1314
"esModuleInterop": true,
1415
"declaration": true,
1516
"allowJs": true,
16-
"lib": ["es2023", "dom"]
17+
"lib": ["es2023", "dom"],
18+
"moduleResolution": "Node"
1719
},
1820
"include": ["./*"],
1921
"files": ["index.ts"]

0 commit comments

Comments
 (0)