@jsenv/core 23.4.1 → 23.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "23.4.1",
3
+ "version": "23.4.2",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -71,7 +71,10 @@ export const createCompiledFileService = ({
71
71
 
72
72
  return (request) => {
73
73
  const { origin, ressource } = request
74
- const requestUrl = `${origin}${ressource}`
74
+ // we use "ressourceToPathname" to remove eventual query param from the url
75
+ // Without this a pattern like "**/*.js" would not match "file.js?t=1"
76
+ // This would result in file not being compiled when they should
77
+ const requestUrl = `${origin}${ressourceToPathname(ressource)}`
75
78
 
76
79
  const requestCompileInfo = serverUrlToCompileInfo(requestUrl, {
77
80
  outDirectoryRelativeUrl,
@@ -276,3 +279,12 @@ const babelPluginMapFromCompileId = (
276
279
 
277
280
  return babelPluginMapForGroup
278
281
  }
282
+
283
+ const ressourceToPathname = (ressource) => {
284
+ const searchSeparatorIndex = ressource.indexOf("?")
285
+ const pathname =
286
+ searchSeparatorIndex === -1
287
+ ? ressource
288
+ : ressource.slice(0, searchSeparatorIndex)
289
+ return pathname
290
+ }
@@ -29,6 +29,7 @@ export const visitNodeV8Directory = async ({
29
29
  const tryReadJsonFile = async () => {
30
30
  const fileContent = await readFile(dirEntryUrl, { as: "string" })
31
31
  if (fileContent === "") {
32
+ console.warn(`Coverage JSON file is empty at ${dirEntryUrl}`)
32
33
  return null
33
34
  }
34
35