@jsenv/core 23.8.18 → 23.8.19

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.8.18",
3
+ "version": "23.8.19",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -279,7 +279,7 @@ export const startCompileServer = async ({
279
279
  jsenvDirectoryClean,
280
280
  compileServerMetaFileInfo,
281
281
  })
282
- writeFile(
282
+ await writeFile(
283
283
  compileServerMetaFileInfo.url,
284
284
  JSON.stringify(compileServerMetaFileInfo.data, null, " "),
285
285
  )
@@ -470,10 +470,20 @@ const cleanOutDirectoryIfNeeded = async ({
470
470
  let previousCompileServerMeta
471
471
  try {
472
472
  const source = await readFile(compileServerMetaFileInfo.url)
473
- previousCompileServerMeta = JSON.parse(source)
473
+ if (source === "") {
474
+ previousCompileServerMeta = null
475
+ logger.debug(
476
+ `compiler server meta file is empty ${compileServerMetaFileInfo.url}`,
477
+ )
478
+ } else {
479
+ previousCompileServerMeta = JSON.parse(source)
480
+ }
474
481
  } catch (e) {
475
482
  if (e.code === "ENOENT") {
476
483
  previousCompileServerMeta = null
484
+ } else if (e.name === "SyntaxError") {
485
+ previousCompileServerMeta = null
486
+ logger.warn(`Syntax error while parsing ${compileServerMetaFileInfo.url}`)
477
487
  } else {
478
488
  throw e
479
489
  }