@jsenv/core 29.3.1 → 29.4.0

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/dist/main.js CHANGED
@@ -15313,7 +15313,7 @@ const jsenvPluginAsJsClassicLibrary = ({
15313
15313
  } else if (context.scenarios.build) {
15314
15314
  jsModuleBundledUrlInfo.sourceUrls.forEach(sourceUrl => {
15315
15315
  const sourceUrlInfo = context.urlGraph.getUrlInfo(sourceUrl);
15316
- if (sourceUrlInfo.dependents.size === 0) {
15316
+ if (sourceUrlInfo && sourceUrlInfo.dependents.size === 0) {
15317
15317
  context.urlGraph.deleteUrlInfo(sourceUrl);
15318
15318
  }
15319
15319
  });
@@ -26332,7 +26332,7 @@ const startBuildServer = async ({
26332
26332
  keepProcessAlive = true,
26333
26333
  rootDirectoryUrl,
26334
26334
  buildDirectoryUrl,
26335
- buildIndexPath = "/index.html",
26335
+ buildIndexPath = "index.html",
26336
26336
  buildServerFiles = {
26337
26337
  "./package.json": true,
26338
26338
  "./jsenv.config.mjs": true
@@ -26359,6 +26359,9 @@ const startBuildServer = async ({
26359
26359
  }
26360
26360
  buildIndexPath = buildIndexUrl.slice(buildDirectoryUrl.length);
26361
26361
  }
26362
+ if (!existsSync(new URL(buildIndexPath, buildDirectoryUrl))) {
26363
+ buildIndexPath = null;
26364
+ }
26362
26365
  }
26363
26366
  const operation = Abort.startOperation();
26364
26367
  operation.addAbortSignal(signal);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "29.3.1",
3
+ "version": "29.4.0",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
package/readme.md CHANGED
@@ -66,8 +66,7 @@ The logo is composed by the name at the center and two circles orbiting around i
66
66
 
67
67
  # See also
68
68
 
69
- | Link | Description |
70
- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
71
- | [@jsenv/assert](https://github.com/jsenv/assert) | NPM package to write assertions |
72
- | [I am too lazy for a test framework](https://dev.to/dmail/i-am-too-lazy-for-a-test-framework-92f) | Article presenting a straightforward testing experience |
73
- | [@jsenv/template-pwa](https://github.com/jsenv/jsenv-template-pwa) | GitHub repository template for a progressive web application |
69
+ | Link | Description |
70
+ | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
71
+ | [@jsenv/assert](./packages/assert) | NPM package to write assertions |
72
+ | [I am too lazy for a test framework](https://dev.to/dmail/i-am-too-lazy-for-a-test-framework-92f) | Article presenting a straightforward testing experience |
@@ -13,6 +13,7 @@
13
13
  * we want to be in the user shoes and we should not alter build files.
14
14
  */
15
15
 
16
+ import { existsSync } from "node:fs"
16
17
  import { parentPort } from "node:worker_threads"
17
18
  import {
18
19
  jsenvAccessControlAllowedHeaders,
@@ -48,7 +49,7 @@ export const startBuildServer = async ({
48
49
 
49
50
  rootDirectoryUrl,
50
51
  buildDirectoryUrl,
51
- buildIndexPath = "/index.html",
52
+ buildIndexPath = "index.html",
52
53
  buildServerFiles = {
53
54
  "./package.json": true,
54
55
  "./jsenv.config.mjs": true,
@@ -77,6 +78,9 @@ export const startBuildServer = async ({
77
78
  }
78
79
  buildIndexPath = buildIndexUrl.slice(buildDirectoryUrl.length)
79
80
  }
81
+ if (!existsSync(new URL(buildIndexPath, buildDirectoryUrl))) {
82
+ buildIndexPath = null
83
+ }
80
84
  }
81
85
 
82
86
  const operation = Abort.startOperation()
@@ -68,7 +68,7 @@ export const jsenvPluginAsJsClassicLibrary = ({
68
68
  } else if (context.scenarios.build) {
69
69
  jsModuleBundledUrlInfo.sourceUrls.forEach((sourceUrl) => {
70
70
  const sourceUrlInfo = context.urlGraph.getUrlInfo(sourceUrl)
71
- if (sourceUrlInfo.dependents.size === 0) {
71
+ if (sourceUrlInfo && sourceUrlInfo.dependents.size === 0) {
72
72
  context.urlGraph.deleteUrlInfo(sourceUrl)
73
73
  }
74
74
  })