Skip to content

Commit daa0cd9

Browse files
committed
feat(upgrade): migrate to ESM
1 parent 6fb7115 commit daa0cd9

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3+
## 3.0.0
4+
- This package is now pure ESM. Please [read this](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
5+
36
## 2.0.1
47
This release adds support for esmodule imports (see #4).
58

jasmine.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"spec_dir": "lib",
33
"spec_files": [
4-
"**/*.spec.js"
4+
"**/*.spec.cjs"
55
]
66
}

package-lock.json

Lines changed: 5 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: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/fetch-event-source",
3-
"version": "2.0.1",
3+
"version": "3.0.0",
44
"description": "A better API for making Event Source requests, with all the features of fetch()",
55
"homepage": "https://github.com/Azure/fetch-event-source#readme",
66
"repository": "github:Azure/fetch-event-source",
@@ -13,10 +13,20 @@
1313
"module": "lib/esm/index.js",
1414
"types": "lib/cjs/index.d.ts",
1515
"sideEffects": false,
16+
"type": "module",
17+
"files": [
18+
"CHANGELOG.md",
19+
"lib",
20+
"tsconfig.esm.json"
21+
],
22+
"engines": {
23+
"node": ">=14.16"
24+
},
1625
"scripts": {
1726
"clean": "rimraf ./lib ./coverage",
1827
"prebuild": "npm run clean",
1928
"build": "tsc && tsc -p tsconfig.esm.json",
29+
"postbuild": "find ./lib/cjs -name \"*.js\" -exec sh -c 'mv \"$1\" \"${1%.js}.cjs\"' _ {} \\;",
2030
"test": "nyc jasmine --config=jasmine.json",
2131
"prepublishOnly": "npm run build && npm run test"
2232
},

src/fetch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventSourceMessage, getBytes, getLines, getMessages } from './parse';
1+
import { EventSourceMessage, getBytes, getLines, getMessages } from './parse.js';
22

33
export const EventStreamContentType = 'text/event-stream';
44

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { fetchEventSource, FetchEventSourceInit, EventStreamContentType } from './fetch';
1+
export { fetchEventSource, FetchEventSourceInit, EventStreamContentType } from './fetch.js';
22
export { EventSourceMessage } from './parse';

0 commit comments

Comments
 (0)