@callstack/repack-dev-server
Advanced tools
Comparing version 4.3.2 to 4.4.0-canary-20240909082848
# @callstack/repack-dev-server | ||
## 4.4.0-canary-20240909082848 | ||
## 4.3.2 | ||
@@ -4,0 +6,0 @@ |
@@ -104,2 +104,3 @@ import { Writable } from 'stream'; | ||
instance.use('/open-url', openURLMiddleware); | ||
// @ts-ignore | ||
instance.use('/open-stack-frame', openStackFrameInEditorMiddleware); | ||
@@ -106,0 +107,0 @@ await instance.register(symbolicatePlugin, { |
@@ -19,7 +19,7 @@ import fastifyPlugin from 'fastify-plugin'; | ||
handler: async (request, reply) => { | ||
let file = request.params['*']; | ||
const filename = request.params['*']; | ||
let { | ||
platform | ||
} = request.query; | ||
if (!file) { | ||
if (!filename) { | ||
// This technically should never happen - this route should not be called if file is missing. | ||
@@ -33,11 +33,2 @@ request.log.error(`File was not provided`); | ||
platform = delegate.compiler.inferPlatform?.(request.url) ?? platform; | ||
if (!platform) { | ||
request.log.error('Cannot detect platform'); | ||
return reply.badRequest('Cannot detect platform'); | ||
} | ||
// If platform happens to be in front of an asset remove it. | ||
if (file.startsWith(`${platform}/`)) { | ||
file = file.replace(`${platform}/`, ''); | ||
} | ||
const multipart = reply.asMultipart(); | ||
@@ -56,4 +47,4 @@ const sendProgress = ({ | ||
try { | ||
const asset = await delegate.compiler.getAsset(file, platform, sendProgress); | ||
const mimeType = delegate.compiler.getMimeType(file, platform, asset); | ||
const asset = await delegate.compiler.getAsset(filename, platform, sendProgress); | ||
const mimeType = delegate.compiler.getMimeType(filename, platform, asset); | ||
if (multipart) { | ||
@@ -60,0 +51,0 @@ const buffer = Buffer.isBuffer(asset) ? asset : Buffer.from(asset); |
@@ -15,3 +15,3 @@ import type { SendProgress } from '../../types'; | ||
*/ | ||
getAsset: (filename: string, platform: string, sendProgress?: SendProgress) => Promise<string | Buffer>; | ||
getAsset: (filename: string, platform: string | undefined, sendProgress?: SendProgress) => Promise<string | Buffer>; | ||
/** | ||
@@ -24,3 +24,3 @@ * Detect MIME type of the asset from `filename`, `platform` or `data` (or from combination of either). | ||
*/ | ||
getMimeType: (filename: string, platform: string, data: string | Buffer) => string; | ||
getMimeType: (filename: string, platform: string | undefined, data: string | Buffer) => string; | ||
/** | ||
@@ -27,0 +27,0 @@ * Detect the platform from the URI - either from filename, query params or both. |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "4.3.2", | ||
"version": "4.4.0-canary-20240909082848", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
237973
2565
1