cloudcmd 19.1.11 → 19.1.13

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.
@@ -170,7 +170,7 @@
170
170
  /******/ // startup
171
171
  /******/ // Load entry module and return exports
172
172
  /******/ // This entry module depends on other loaded chunks and execution need to be delayed
173
- /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/modules/config/index.js")))
173
+ /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/modules/config/index.mjs")))
174
174
  /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
175
175
  /******/
176
176
  /******/ })()
package/dist-dev/sw.js CHANGED
@@ -9,14 +9,14 @@
9
9
  /******/ (() => { // webpackBootstrap
10
10
  /******/ var __webpack_modules__ = ({
11
11
 
12
- /***/ "./client/sw/sw.js"
13
- /*!*************************!*\
14
- !*** ./client/sw/sw.js ***!
15
- \*************************/
16
- (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
12
+ /***/ "./client/sw/sw.mjs"
13
+ /*!**************************!*\
14
+ !*** ./client/sw/sw.mjs ***!
15
+ \**************************/
16
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17
17
 
18
18
  "use strict";
19
- eval("{\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\nconst {\n tryToCatch\n} = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.cjs\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Sun Jan 25 2026 22:54:03 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nglobalThis.addEventListener('install', wait(onInstall));\nglobalThis.addEventListener('fetch', respondWith(onFetch));\nglobalThis.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await globalThis.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await globalThis.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/sw/sw.js\n}");
19
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n/* harmony import */ var try_to_catch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n/* harmony import */ var currify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\n\n\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => e.waitUntil(f()));\nconst respondWith = currify__WEBPACK_IMPORTED_MODULE_2__((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Tue Jan 27 2026 21:18:46 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nglobalThis.addEventListener('install', wait(onInstall));\nglobalThis.addEventListener('fetch', respondWith(onFetch));\nglobalThis.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await globalThis.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await globalThis.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await (0,try_to_catch__WEBPACK_IMPORTED_MODULE_1__.tryToCatch)(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/client/sw/sw.mjs\n}");
20
20
 
21
21
  /***/ },
22
22
 
@@ -41,17 +41,6 @@ eval("{// shim for using process in browser\nvar process = module.exports = {};\
41
41
 
42
42
  /***/ },
43
43
 
44
- /***/ "./node_modules/try-to-catch/lib/try-to-catch.cjs"
45
- /*!********************************************************!*\
46
- !*** ./node_modules/try-to-catch/lib/try-to-catch.cjs ***!
47
- \********************************************************/
48
- (module, __unused_webpack_exports, __webpack_require__) {
49
-
50
- "use strict";
51
- eval("{\n\nconst {tryToCatch} = __webpack_require__(/*! ./try-to-catch.js */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nmodule.exports = tryToCatch;\nmodule.exports.tryToCatch = tryToCatch;\n\n\n//# sourceURL=file://cloudcmd//Users/coderaiser/cloudcmd/node_modules/try-to-catch/lib/try-to-catch.cjs\n}");
52
-
53
- /***/ },
54
-
55
44
  /***/ "./node_modules/try-to-catch/lib/try-to-catch.js"
56
45
  /*!*******************************************************!*\
57
46
  !*** ./node_modules/try-to-catch/lib/try-to-catch.js ***!
@@ -129,7 +118,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
129
118
  /******/ // startup
130
119
  /******/ // Load entry module and return exports
131
120
  /******/ // This entry module can't be inlined because the eval devtool is used.
132
- /******/ var __webpack_exports__ = __webpack_require__("./client/sw/sw.js");
121
+ /******/ var __webpack_exports__ = __webpack_require__("./client/sw/sw.mjs");
133
122
  /******/
134
123
  /******/ })()
135
124
  ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "19.1.11",
3
+ "version": "19.1.13",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "File manager for the web with console and editor",
@@ -219,7 +219,8 @@
219
219
  "webpackbar": "^7.0.0"
220
220
  },
221
221
  "imports": {
222
- "#dom/events": "./client/dom/events/index.mjs"
222
+ "#dom/events": "./client/dom/events/index.mjs",
223
+ "#dom/load": "./client/dom/load.mjs"
223
224
  },
224
225
  "engines": {
225
226
  "node": ">=22"
@@ -285,10 +285,12 @@ function setUrl(req, res, next) {
285
285
 
286
286
  function setSW(req, res, next) {
287
287
  const {url} = req;
288
- const isSW = /^\/sw\.js(\.map)?$/.test(url);
288
+ const isSW = /^\/sw\.[mc]?js(\.map)?$/.test(url);
289
289
 
290
- if (isSW)
290
+ if (isSW) {
291
+ const url = req.url.replace(/[cm]js/, 'js');
291
292
  req.url = replaceDist(`/dist${url}`);
293
+ }
292
294
 
293
295
  next();
294
296
  }