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

dependency: bump mime dependency to 3.0 #30966

Merged
merged 34 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
29b3c9b
dependency: bump mime dep
jennifer-shehane Jan 28, 2025
b7a7668
changelog entry
jennifer-shehane Jan 28, 2025
d6d7441
yarn lock update
jennifer-shehane Jan 28, 2025
ccff6a9
add pending to changelog
jennifer-shehane Jan 28, 2025
e00e3bc
index on mime-dep-update: ccff6a976e add pending to changelog
Jan 28, 2025
fa22fd5
WIP on mime-dep-update: ccff6a976e add pending to changelog
Jan 28, 2025
19e500d
index on mime-dep-update: ccff6a976e add pending to changelog
Jan 28, 2025
82dcac0
WIP on mime-dep-update: ccff6a976e add pending to changelog
Jan 28, 2025
9dd0bd0
Merge commit 'stash' into mime-dep-update
Jan 28, 2025
109b5e4
another removal of package
jennifer-shehane Jan 28, 2025
a850d65
changelog update
jennifer-shehane Jan 28, 2025
73dfe8e
Merge branch 'mime-dep-update' of https://github.com/cypress-io/cypre…
jennifer-shehane Jan 28, 2025
7622226
index on mime-dep-update: ccff6a976e add pending to changelog
Jan 28, 2025
4e59a4a
WIP on mime-dep-update: ccff6a976e add pending to changelog
Jan 28, 2025
3c38c87
Merge commit 'stash' into mime-dep-update
Jan 28, 2025
da4c161
whoops wrong issue
jennifer-shehane Jan 28, 2025
509a16a
Merge branch 'mime-dep-update' of https://github.com/cypress-io/cypre…
jennifer-shehane Jan 28, 2025
438439a
Merge branch 'develop' into mime-dep-update
jennifer-shehane Jan 29, 2025
73ed5b0
fix test that was just....wrong
jennifer-shehane Jan 29, 2025
b76fa7f
Merge branch 'mime-dep-update' of https://github.com/cypress-io/cypre…
jennifer-shehane Jan 29, 2025
57da27c
Revert "fix test that was just....wrong"
jennifer-shehane Jan 29, 2025
dd03518
nvm, application/javascript is obsolete
jennifer-shehane Jan 29, 2025
10c6feb
app/js to text/js updates
jennifer-shehane Jan 29, 2025
f08b047
downgrade to mime 3.0.0
AtofStryker Jan 29, 2025
845ba4e
back to application/javascript
jennifer-shehane Jan 29, 2025
23cbb77
Merge branch 'mime-dep-update' of https://github.com/cypress-io/cypre…
jennifer-shehane Jan 29, 2025
f9dec40
index on mime-dep-update: 23cbb7783b Merge branch 'mime-dep-update' o…
Jan 29, 2025
c79c066
WIP on mime-dep-update: 23cbb7783b Merge branch 'mime-dep-update' of …
Jan 29, 2025
4e0156f
index on mime-dep-update: 23cbb7783b Merge branch 'mime-dep-update' o…
Jan 29, 2025
31ceabf
WIP on mime-dep-update: 23cbb7783b Merge branch 'mime-dep-update' of …
Jan 29, 2025
a87cbc9
Merge commit 'stash' into mime-dep-update
Jan 29, 2025
549ba91
index on mime-dep-update: 23cbb7783b Merge branch 'mime-dep-update' o…
Jan 29, 2025
91a44cf
WIP on mime-dep-update: 23cbb7783b Merge branch 'mime-dep-update' of …
Jan 29, 2025
1b61f92
Merge commit 'stash' into mime-dep-update
Jan 29, 2025
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
8 changes: 8 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 14.0.2

_Released 2/11/2025 (PENDING)_

**Dependency Updates:**

- Upgraded `mime` from `2.6.0` to `3.0.0`. Addressed in [#30966](https://github.com/cypress-io/cypress/pull/30966).

## 14.0.1

_Released 1/28/2025_
Expand Down
56 changes: 28 additions & 28 deletions packages/driver/cypress/e2e/e2e/service-worker.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -101,7 +101,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -121,7 +121,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -141,7 +141,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -159,7 +159,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -179,7 +179,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -196,7 +196,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -220,7 +220,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -245,7 +245,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -271,7 +271,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -293,7 +293,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -317,7 +317,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -336,7 +336,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -359,7 +359,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand Down Expand Up @@ -388,7 +388,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -414,7 +414,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('/fixtures/service-worker.html')
Expand All @@ -437,7 +437,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('/fixtures/service-worker.html')
Expand All @@ -457,7 +457,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('/fixtures/service-worker.html')
Expand Down Expand Up @@ -495,7 +495,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand Down Expand Up @@ -523,7 +523,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand Down Expand Up @@ -551,7 +551,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -564,7 +564,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand Down Expand Up @@ -595,7 +595,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html').then(async (win) => {
Expand All @@ -621,7 +621,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -640,7 +640,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -658,7 +658,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html')
Expand All @@ -676,7 +676,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.visit('fixtures/service-worker.html?skipReload')
Expand All @@ -694,7 +694,7 @@ describe('service workers', { defaultCommandTimeout: 1000, pageLoadTimeout: 1000

cy.intercept('/fixtures/service-worker.js', (req) => {
req.reply(`(${script})()`,
{ 'Content-Type': 'application/javascript' })
{ 'Content-Type': 'text/javascript' })
})

cy.intercept('/fixtures/1mb*', (req) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@types/common-tags": "^1.8.0",
"@types/crypto-js": "4.1.1",
"@types/jquery.scrollto": "1.4.29",
"@types/mime": "^3.0.1",
"@types/mocha": "^8.0.3",
"@types/sinonjs__fake-timers": "8.1.1",
"basic-auth": "2.0.1",
Expand Down Expand Up @@ -67,7 +68,7 @@
"md5": "2.3.0",
"method-override": "3.0.0",
"methods": "1.1.2",
"mime-types": "2.1.27",
"mime": "^3.0.0",
"minimatch": "3.1.2",
"mocha": "7.0.1",
"multer": "1.4.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/driver/src/cy/commands/actions/selectFile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { basename } from 'path'
import _ from 'lodash'
import mime from 'mime-types'
import mime from 'mime'

import $dom from '../../../dom'
import $errUtils from '../../../cypress/error_utils'
Expand Down Expand Up @@ -44,7 +44,7 @@ const createDataTransfer = (files: Cypress.FileReferenceObject[], eventTarget: J
files.forEach(({
contents,
fileName = '',
mimeType = mime.lookup(fileName) || '',
mimeType = mime.getType(fileName) || '',
lastModified = Date.now(),
}) => {
const file = new targetWindow.File([contents], fileName, { lastModified, type: mimeType })
Expand Down
3 changes: 1 addition & 2 deletions packages/net-stubbing/lib/server/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type CyServer from '@packages/server'
import { Socket } from 'net'
import type { GetFixtureFn } from './types'
import ThrottleStream from 'throttle'
import MimeTypes from 'mime-types'
import type { CypressIncomingRequest } from '@packages/proxy'
import type { InterceptedRequest } from './intercepted-request'
import { caseInsensitiveGet, caseInsensitiveHas } from '../util'
Expand Down Expand Up @@ -154,7 +153,7 @@ export async function setResponseFromFixture (getFixtureFn: GetFixtureFn, static

if (!headers || !caseInsensitiveGet(headers, 'content-type')) {
// attempt to detect mimeType based on extension, fall back to regular cy.fixture inspection otherwise
const mimeType = MimeTypes.lookup(fixture.filePath) || parseContentType(data)
const mimeType = mime.getType(fixture.filePath) || parseContentType(data)

_.set(staticResponse, 'headers.content-type', mimeType)
}
Expand Down
5 changes: 2 additions & 3 deletions packages/net-stubbing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
"tslint": "tslint --config ../ts/tslint.json --project ."
},
"dependencies": {
"@types/mime-types": "2.1.0",
"is-html": "^2.0.0",
"istextorbinary": "6.0.0",
"lodash": "^4.17.15",
"mime": "^2.6.0",
"mime-types": "2.1.27",
"mime": "^3.0.0",
"minimatch": "^3.1.2",
"throttle": "^1.0.3"
},
"devDependencies": {
"@types/mime": "^3.0.1",
"chai": "4.2.0",
"mocha": "7.1.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/server/lib/controllers/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
}

return res
.type('application/javascript')
.type('text/javascript')
.set('ETag', clientVersion)
.status(200)
// TODO: replace this entire file and sendFile call with `express.static`.
Expand Down
4 changes: 2 additions & 2 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@ffmpeg-installer/ffmpeg": "1.1.0",
"@packages/icons": "0.0.0-development",
"@packages/telemetry": "0.0.0-development",
"@types/mime": "^3.0.1",
"ansi_up": "5.0.0",
"ast-types": "0.13.3",
"base64url": "^3.0.1",
Expand Down Expand Up @@ -92,7 +93,7 @@
"log-symbols": "2.2.0",
"md5": "2.3.0",
"memfs": "3.5.3",
"mime": "2.6.0",
"mime": "^3.0.0",
"mime-db": "1.45.0",
"minimatch": "3.1.2",
"minimist": "1.2.8",
Expand Down Expand Up @@ -163,7 +164,6 @@
"@types/chrome": "0.0.101",
"@types/chrome-remote-interface": "0.31.14",
"@types/http-proxy": "1.17.4",
"@types/mime": "3.0.1",
"@types/node": "20.16.0",
"@types/request-promise": "^4.1.48",
"babel-loader": "9.1.3",
Expand Down
Loading
Loading