@jsenv/core 39.11.0 → 39.11.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.
@@ -8399,6 +8399,10 @@ const getMtimeResponse = async ({ headers, fileStat }) => {
8399
8399
  };
8400
8400
 
8401
8401
  const getCompressedResponse = async ({ fileUrl, headers }) => {
8402
+ const contentType = CONTENT_TYPE.fromUrlExtension(fileUrl);
8403
+ if (CONTENT_TYPE.isBinary(contentType)) {
8404
+ return null;
8405
+ }
8402
8406
  const acceptedCompressionFormat = pickContentEncoding(
8403
8407
  { headers },
8404
8408
  Object.keys(availableCompressionFormats),
@@ -8416,7 +8420,7 @@ const getCompressedResponse = async ({ fileUrl, headers }) => {
8416
8420
  return {
8417
8421
  status: 200,
8418
8422
  headers: {
8419
- "content-type": CONTENT_TYPE.fromUrlExtension(fileUrl),
8423
+ "content-type": contentType,
8420
8424
  "content-encoding": acceptedCompressionFormat,
8421
8425
  "vary": "accept-encoding",
8422
8426
  },
@@ -19536,14 +19540,16 @@ const generateDirectoryNav = (
19536
19540
  entryDirectoryUrl,
19537
19541
  rootDirectoryUrl,
19538
19542
  );
19539
- const isDir = entryDirectoryRelativeUrl.endsWith("/");
19543
+ const isDir =
19544
+ entryDirectoryRelativeUrl === "" || entryDirectoryRelativeUrl.endsWith("/");
19540
19545
  const rootDirectoryUrlName = urlToFilename$1(rootDirectoryUrl);
19541
19546
  const items = [];
19542
19547
  let dirPartsHtml = "";
19543
- const parts =
19544
- `${rootDirectoryUrlName}/${entryDirectoryRelativeUrl.slice(0, -1)}`.split(
19545
- "/",
19546
- );
19548
+ const parts = entryDirectoryRelativeUrl
19549
+ ? `${rootDirectoryUrlName}/${entryDirectoryRelativeUrl.slice(0, -1)}`.split(
19550
+ "/",
19551
+ )
19552
+ : [rootDirectoryUrlName];
19547
19553
  let i = 0;
19548
19554
  while (i < parts.length) {
19549
19555
  const part = parts[i];
@@ -19559,6 +19565,8 @@ const generateDirectoryNav = (
19559
19565
  : directoryUrl;
19560
19566
  if (href === "") {
19561
19567
  href = `/${directoryContentMagicName}`;
19568
+ } else {
19569
+ href = `/${href}`;
19562
19570
  }
19563
19571
  const text = part;
19564
19572
  items.push({
@@ -19569,7 +19577,7 @@ const generateDirectoryNav = (
19569
19577
  }
19570
19578
  i = 0;
19571
19579
  for (const { href, text } of items) {
19572
- const isLastPart = i === parts.length - 1;
19580
+ const isLastPart = i === items.length - 1;
19573
19581
  if (isLastPart) {
19574
19582
  dirPartsHtml += `
19575
19583
  <span class="directory_nav_item" data-current>
@@ -24605,7 +24613,7 @@ const createBuildFilesService = ({ buildDirectoryUrl, buildMainFilePath }) => {
24605
24613
  ? `private,max-age=${SECONDS_IN_30_DAYS},immutable`
24606
24614
  : "private,max-age=0,must-revalidate",
24607
24615
  etagEnabled: true,
24608
- compressionEnabled: !request.pathname.endsWith(".mp4"),
24616
+ compressionEnabled: true,
24609
24617
  rootDirectoryUrl: buildDirectoryUrl,
24610
24618
  canReadDirectory: true,
24611
24619
  ENOENTFallback: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "39.11.0",
3
+ "version": "39.11.2",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -81,7 +81,7 @@
81
81
  "@jsenv/plugin-supervisor": "1.6.3",
82
82
  "@jsenv/plugin-transpilation": "1.4.92",
83
83
  "@jsenv/runtime-compat": "1.3.1",
84
- "@jsenv/server": "15.4.0",
84
+ "@jsenv/server": "15.4.1",
85
85
  "@jsenv/sourcemap": "1.2.30",
86
86
  "@jsenv/url-meta": "8.5.2",
87
87
  "@jsenv/urls": "2.6.0",
@@ -103,13 +103,13 @@
103
103
  "@jsenv/plugin-as-js-classic": "workspace:*",
104
104
  "@jsenv/snapshot": "workspace:*",
105
105
  "@jsenv/test": "workspace:*",
106
- "@playwright/browser-chromium": "1.49.1",
107
- "@playwright/browser-firefox": "1.49.1",
108
- "@playwright/browser-webkit": "1.49.1",
106
+ "@playwright/browser-chromium": "1.50.0",
107
+ "@playwright/browser-firefox": "1.50.0",
108
+ "@playwright/browser-webkit": "1.50.0",
109
109
  "babel-plugin-transform-async-to-promises": "0.8.18",
110
- "eslint": "9.18.0",
110
+ "eslint": "9.19.0",
111
111
  "open": "10.1.0",
112
- "playwright": "1.49.1",
112
+ "playwright": "1.50.0",
113
113
  "prettier": "3.4.2",
114
114
  "prettier-plugin-organize-imports": "4.1.0",
115
115
  "strip-ansi": "7.1.0"
@@ -176,7 +176,7 @@ const createBuildFilesService = ({ buildDirectoryUrl, buildMainFilePath }) => {
176
176
  ? `private,max-age=${SECONDS_IN_30_DAYS},immutable`
177
177
  : "private,max-age=0,must-revalidate",
178
178
  etagEnabled: true,
179
- compressionEnabled: !request.pathname.endsWith(".mp4"),
179
+ compressionEnabled: true,
180
180
  rootDirectoryUrl: buildDirectoryUrl,
181
181
  canReadDirectory: true,
182
182
  ENOENTFallback: () => {
@@ -238,14 +238,16 @@ const generateDirectoryNav = (
238
238
  entryDirectoryUrl,
239
239
  rootDirectoryUrl,
240
240
  );
241
- const isDir = entryDirectoryRelativeUrl.endsWith("/");
241
+ const isDir =
242
+ entryDirectoryRelativeUrl === "" || entryDirectoryRelativeUrl.endsWith("/");
242
243
  const rootDirectoryUrlName = urlToFilename(rootDirectoryUrl);
243
244
  const items = [];
244
245
  let dirPartsHtml = "";
245
- const parts =
246
- `${rootDirectoryUrlName}/${entryDirectoryRelativeUrl.slice(0, -1)}`.split(
247
- "/",
248
- );
246
+ const parts = entryDirectoryRelativeUrl
247
+ ? `${rootDirectoryUrlName}/${entryDirectoryRelativeUrl.slice(0, -1)}`.split(
248
+ "/",
249
+ )
250
+ : [rootDirectoryUrlName];
249
251
  let i = 0;
250
252
  while (i < parts.length) {
251
253
  const part = parts[i];
@@ -261,6 +263,8 @@ const generateDirectoryNav = (
261
263
  : directoryUrl;
262
264
  if (href === "") {
263
265
  href = `/${directoryContentMagicName}`;
266
+ } else {
267
+ href = `/${href}`;
264
268
  }
265
269
  const text = part;
266
270
  items.push({
@@ -271,7 +275,7 @@ const generateDirectoryNav = (
271
275
  }
272
276
  i = 0;
273
277
  for (const { href, text } of items) {
274
- const isLastPart = i === parts.length - 1;
278
+ const isLastPart = i === items.length - 1;
275
279
  if (isLastPart) {
276
280
  dirPartsHtml += `
277
281
  <span class="directory_nav_item" data-current>