@jsenv/core 41.4.16 → 41.4.18

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.
@@ -46,10 +46,27 @@ const DirectoryListing = () => {
46
46
  const ErrorMessage = () => {
47
47
  const {
48
48
  filePathExisting,
49
- filePathNotFound
49
+ filePathNotFound,
50
+ spaFallbackFilePaths
50
51
  } = enoentDetails;
51
52
  let errorText;
52
53
  let errorSuggestion;
54
+ let spaExplanation = null;
55
+ if (spaFallbackFilePaths) {
56
+ spaExplanation = u($, {
57
+ children: [u("strong", {
58
+ children: "SPA mode:"
59
+ }), " a url without extension is a route, served with the closest html file. None of these exists:", u("ul", {
60
+ className: "spa_fallback_list",
61
+ style: "margin: 6px 0 0; padding-left: 20px;",
62
+ children: spaFallbackFilePaths.map(filePath => u("li", {
63
+ children: [u("code", {
64
+ children: filePath
65
+ }), filePath === `/${mainFilePath}` ? " (main file)" : ""]
66
+ }, filePath))
67
+ })]
68
+ });
69
+ }
53
70
  errorText = u($, {
54
71
  children: [u("strong", {
55
72
  children: "File not found:"
@@ -79,7 +96,11 @@ const ErrorMessage = () => {
79
96
  children: [u("p", {
80
97
  className: "error_text",
81
98
  children: errorText
82
- }), u("p", {
99
+ }), spaExplanation ? u("p", {
100
+ className: "error_spa",
101
+ style: "margin-top: 10px;",
102
+ children: spaExplanation
103
+ }) : null, u("p", {
83
104
  className: "error_suggestion",
84
105
  style: "font-size: 0.8em; margin-top: 10px;",
85
106
  children: errorSuggestion