cloudcmd 19.8.7 → 19.8.8

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/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 2026.03.23, v19.8.8
2
+
3
+ feature:
4
+ - 02dbe56d server: user-menu: when error send it
5
+
1
6
  2026.03.23, v19.8.7
2
7
 
3
8
  feature:
package/HELP.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cloud Commander v19.8.7
1
+ # Cloud Commander v19.8.8
2
2
 
3
3
  ### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL]
4
4
 
@@ -1111,6 +1111,7 @@ There are a lot of ways to be involved in `Cloud Commander` development:
1111
1111
 
1112
1112
  ## Version history
1113
1113
 
1114
+ - *2026.03.23*, **[v19.8.8](//github.com/coderaiser/cloudcmd/releases/tag/v19.8.8)**
1114
1115
  - *2026.03.23*, **[v19.8.7](//github.com/coderaiser/cloudcmd/releases/tag/v19.8.7)**
1115
1116
  - *2026.03.23*, **[v19.8.6](//github.com/coderaiser/cloudcmd/releases/tag/v19.8.6)**
1116
1117
  - *2026.03.23*, **[v19.8.5](//github.com/coderaiser/cloudcmd/releases/tag/v19.8.5)**
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cloud Commander v19.8.7 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL]
1
+ # Cloud Commander v19.8.8 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL]
2
2
 
3
3
  ### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL]
4
4
 
package/dist/sw.js CHANGED
@@ -311,7 +311,7 @@ const respondWith = currify((f, e) => {
311
311
  e.respondWith(f(e));
312
312
  });
313
313
  const getPathName = url => new URL(url).pathname;
314
- const date = "Mon Mar 23 2026 12:13:08 GMT+0200 (Eastern European Standard Time)";
314
+ const date = "Mon Mar 23 2026 12:23:15 GMT+0200 (Eastern European Standard Time)";
315
315
  const NAME = `cloudcmd: ${date}`;
316
316
  const createRequest = a => new Request(a, {
317
317
  credentials: 'same-origin'
package/dist-dev/sw.js CHANGED
@@ -37,7 +37,7 @@ eval("{// shim for using process in browser\nvar process = module.exports = {};\
37
37
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
38
38
 
39
39
  "use strict";
40
- 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 = \"Mon Mar 23 2026 12:13:11 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.js\n}");
40
+ 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 = \"Mon Mar 23 2026 12:23:17 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.js\n}");
41
41
 
42
42
  /***/ },
43
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "19.8.7",
3
+ "version": "19.8.8",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "File manager for the web with console and editor",
@@ -1,7 +1,6 @@
1
1
  import {homedir} from 'node:os';
2
2
  import {readFile as _readFile} from 'node:fs/promises';
3
3
  import {join} from 'node:path';
4
- import {readFileSync} from 'node:fs';
5
4
  // warm up worker cache
6
5
  import montag from 'montag';
7
6
  import {tryToCatch} from 'try-to-catch';
@@ -35,7 +34,9 @@ async function onGET({req, res, menuName, readFile}) {
35
34
  const url = req.url.replace(PREFIX, '');
36
35
 
37
36
  if (url === '/default')
38
- return await sendDefaultMenu(res);
37
+ return await sendDefaultMenu(res, {
38
+ readFile,
39
+ });
39
40
 
40
41
  const {findUp} = await import('find-up');
41
42
 
@@ -58,7 +59,9 @@ async function onGET({req, res, menuName, readFile}) {
58
59
  .send(e.message);
59
60
 
60
61
  if (e)
61
- return await sendDefaultMenu(res);
62
+ return await sendDefaultMenu(res, {
63
+ readFile,
64
+ });
62
65
 
63
66
  const [parseError, result] = await transpile(source);
64
67
 
@@ -86,8 +89,10 @@ function getError(error, source) {
86
89
  `;
87
90
  }
88
91
 
89
- async function sendDefaultMenu(res) {
90
- const menu = await getDefaultMenu();
92
+ async function sendDefaultMenu(res, {readFile}) {
93
+ const menu = await getDefaultMenu({
94
+ readFile,
95
+ });
91
96
 
92
97
  res
93
98
  .type('js')
@@ -106,10 +111,13 @@ async function transpile(source) {
106
111
  });
107
112
  }
108
113
 
109
- async function getDefaultMenu() {
114
+ async function getDefaultMenu({readFile}) {
110
115
  const DEFAULT_MENU_PATH = new URL('../static/user-menu.js', import.meta.url).pathname;
111
- const menu = readFileSync(DEFAULT_MENU_PATH, 'utf8');
112
- const [, result] = await transpile(menu);
116
+ const menu = await readFile(DEFAULT_MENU_PATH, 'utf8');
117
+ const [error, result] = await transpile(menu);
118
+
119
+ if (error)
120
+ return String(error);
113
121
 
114
122
  return result.code;
115
123
  }