Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [email protected] #126

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ This is a [Node.js](https://nodejs.org/en/) module available through the
$ npm install mime-types
```

## Note on MIME Type Data and Semver

This package considers the programmatic api as the semver compatibility. Additionally, the package which provides the MIME data
for this package (`mime-db`) *also* considers it's programmatic api as the semver contract. This means the MIME type resolution is *not* considered
in the semver bumps.

In the past the version of `mime-db` was pinned to give two decision points when adopting MIME data changes. This is no longer true. We still update the
`mime-db` package here as a `minor` release when necessary, but will use a `^` range going forward. This means that if you want to pin your `mime-db` data
you will need to do it in your application. While this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is
a breaking change.
Copy link
Member

@blakeembrey blakeembrey Jul 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds good to me. I think the argument is that if you didn't pin already, you expected updates on resolution automatically, and if you did pin, you didn't. This breaks the "you didn't" case, but since those users are currently pinned I agree with the change. Let's ensure the release notes are very clear (big and bold) to highlight this for pinned users.

I still think it's clearer to consider a major version that changes the way the API works and this change at the same time, but it's certainly easier (on both us and users) to consider this non-breaking.


If you wish to pin your `mime-db` version you can do that with overrides via your package manager of choice. See their documentation for how to correctly configure that.

## Adding Types

All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"repository": "jshttp/mime-types",
"dependencies": {
"mime-db": "1.52.0"
"mime-db": "^1.53.0"
},
"devDependencies": {
"eslint": "8.33.0",
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ describe('mimeTypes', function () {
})

it('should return mime type for ".js"', function () {
assert.strictEqual(mimeTypes.lookup('.js'), 'application/javascript')
assert.strictEqual(mimeTypes.lookup('.js'), 'text/javascript')
})

it('should return mime type for ".json"', function () {
Expand Down
Loading