cloudcmd 16.17.9 → 17.0.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.
Files changed (62) hide show
  1. package/ChangeLog +18 -0
  2. package/HELP.md +3 -1
  3. package/README.md +1 -1
  4. package/dist/cloudcmd.common.js +3 -3
  5. package/dist/cloudcmd.common.js.map +1 -1
  6. package/dist/cloudcmd.css +1 -1
  7. package/dist/cloudcmd.js +1 -1
  8. package/dist/cloudcmd.js.map +1 -1
  9. package/dist/modules/cloud.js +1 -1
  10. package/dist/modules/cloud.js.map +1 -1
  11. package/dist/modules/command-line.js +1 -1
  12. package/dist/modules/command-line.js.map +1 -1
  13. package/dist/modules/config.js +1 -1
  14. package/dist/modules/config.js.map +1 -1
  15. package/dist/modules/contact.js +1 -1
  16. package/dist/modules/contact.js.map +1 -1
  17. package/dist/modules/edit-file-vim.js +1 -1
  18. package/dist/modules/edit-file-vim.js.map +1 -1
  19. package/dist/modules/edit-file.js +1 -1
  20. package/dist/modules/edit-file.js.map +1 -1
  21. package/dist/modules/edit-names-vim.js +1 -1
  22. package/dist/modules/edit-names-vim.js.map +1 -1
  23. package/dist/modules/edit-names.js +1 -1
  24. package/dist/modules/edit-names.js.map +1 -1
  25. package/dist/modules/edit.js +1 -1
  26. package/dist/modules/edit.js.map +1 -1
  27. package/dist/modules/help.js +1 -1
  28. package/dist/modules/help.js.map +1 -1
  29. package/dist/modules/konsole.js +1 -1
  30. package/dist/modules/konsole.js.map +1 -1
  31. package/dist/modules/markdown.js +1 -1
  32. package/dist/modules/markdown.js.map +1 -1
  33. package/dist/modules/menu.js +1 -1
  34. package/dist/modules/menu.js.map +1 -1
  35. package/dist/modules/operation.js +1 -1
  36. package/dist/modules/operation.js.map +1 -1
  37. package/dist/modules/polyfill.js +1 -1
  38. package/dist/modules/polyfill.js.map +1 -1
  39. package/dist/modules/terminal-run.js +1 -1
  40. package/dist/modules/terminal-run.js.map +1 -1
  41. package/dist/modules/terminal.js +1 -1
  42. package/dist/modules/terminal.js.map +1 -1
  43. package/dist/modules/upload.js +1 -1
  44. package/dist/modules/upload.js.map +1 -1
  45. package/dist/modules/user-menu.js +1 -1
  46. package/dist/modules/user-menu.js.map +1 -1
  47. package/dist/modules/view.js +1 -1
  48. package/dist/modules/view.js.map +1 -1
  49. package/dist/sw.js +1 -1
  50. package/dist-dev/cloudcmd.common.js +11 -45
  51. package/dist-dev/cloudcmd.css +179 -160
  52. package/dist-dev/cloudcmd.js +14 -2
  53. package/dist-dev/columns/name-size-date.css +0 -1
  54. package/dist-dev/config.css +24 -10
  55. package/dist-dev/nojs.css +2 -1
  56. package/dist-dev/sw.js +1 -1
  57. package/dist-dev/terminal.css +0 -1
  58. package/dist-dev/user-menu.css +0 -1
  59. package/dist-dev/view.css +4 -3
  60. package/package.json +11 -11
  61. package/server/route.js +0 -2
  62. package/server/user-menu.js +15 -16
@@ -247,7 +247,19 @@ eval("\n\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_module
247
247
  /***/ (function(module, exports, __webpack_require__) {
248
248
 
249
249
  "use strict";
250
- eval("\n\n/* global CloudCmd */\n/* global DOM */\nconst vim = __webpack_require__(/*! ./vim */ \"./client/key/vim/vim.js\");\nconst finder = __webpack_require__(/*! ./find */ \"./client/key/vim/find.js\");\nconst {\n Dialog\n} = DOM;\nconst DEPS = {\n ...DOM,\n ...CloudCmd\n};\nmodule.exports = async (key, event, deps = DEPS) => {\n const operations = getOperations(event, deps);\n await vim(key, operations);\n};\nconst getOperations = (event, deps) => {\n const {\n Info = DOM.CurrentInfo,\n Operation,\n unselectFiles,\n setCurrentFile,\n setCurrentByName,\n getCurrentName,\n toggleSelectedFile,\n Buffer = {}\n } = deps;\n return {\n escape: unselectFiles,\n remove: () => {\n Operation.show('delete');\n },\n makeDirectory: () => {\n event.stopImmediatePropagation();\n event.preventDefault();\n DOM.promptNewDir();\n },\n makeFile: () => {\n event.stopImmediatePropagation();\n event.preventDefault();\n DOM.promptNewFile();\n },\n terminal: () => {\n CloudCmd.Terminal.show();\n },\n edit: () => {\n CloudCmd.EditFileVim.show();\n },\n copy: () => {\n Buffer.copy();\n unselectFiles();\n },\n select: () => {\n const current = Info.element;\n toggleSelectedFile(current);\n },\n paste: Buffer.paste,\n moveNext: ({\n count,\n isVisual,\n isDelete\n }) => {\n setCurrent('next', {\n count,\n isVisual,\n isDelete\n }, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n });\n },\n movePrevious: ({\n count,\n isVisual,\n isDelete\n }) => {\n setCurrent('previous', {\n count,\n isVisual,\n isDelete\n }, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n });\n },\n find: async () => {\n event.preventDefault();\n const [, value] = await Dialog.prompt('Find', '');\n if (!value) return;\n const names = Info.files.map(getCurrentName);\n const [result] = finder.find(value, names);\n setCurrentByName(result);\n },\n findNext: () => {\n const name = finder.findNext();\n setCurrentByName(name);\n },\n findPrevious: () => {\n const name = finder.findPrevious();\n setCurrentByName(name);\n }\n };\n};\nmodule.exports.selectFile = selectFileNotParent;\nfunction selectFileNotParent(current, {\n getCurrentName,\n selectFile\n} = DOM) {\n const name = getCurrentName(current);\n if (name === '..') return;\n selectFile(current);\n}\nfunction setCurrent(sibling, {\n count,\n isVisual,\n isDelete\n}, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n}) {\n let current = Info.element;\n const select = isVisual ? selectFileNotParent : unselectFiles;\n select(current);\n const position = `${sibling}Sibling`;\n for (let i = 0; i < count; i++) {\n const next = current[position];\n if (!next) break;\n current = next;\n select(current);\n }\n setCurrentFile(current);\n if (isDelete) Operation.show('delete');\n}\n\n//# sourceURL=file://cloudcmd/client/key/vim/index.js");
250
+ eval("\n\n/* global CloudCmd */\n/* global DOM */\nconst vim = __webpack_require__(/*! ./vim */ \"./client/key/vim/vim.js\");\nconst finder = __webpack_require__(/*! ./find */ \"./client/key/vim/find.js\");\nconst {\n setCurrent,\n selectFileNotParent\n} = __webpack_require__(/*! ./set-current */ \"./client/key/vim/set-current.js\");\nconst {\n Dialog\n} = DOM;\nconst DEPS = {\n ...DOM,\n ...CloudCmd\n};\nmodule.exports = async (key, event, deps = DEPS) => {\n const operations = getOperations(event, deps);\n await vim(key, operations);\n};\nconst getOperations = (event, deps) => {\n const {\n Info = DOM.CurrentInfo,\n Operation,\n unselectFiles,\n setCurrentFile,\n setCurrentByName,\n getCurrentName,\n toggleSelectedFile,\n Buffer = {}\n } = deps;\n return {\n escape: unselectFiles,\n remove: () => {\n Operation.show('delete');\n },\n makeDirectory: () => {\n event.stopImmediatePropagation();\n event.preventDefault();\n DOM.promptNewDir();\n },\n makeFile: () => {\n event.stopImmediatePropagation();\n event.preventDefault();\n DOM.promptNewFile();\n },\n terminal: () => {\n CloudCmd.Terminal.show();\n },\n edit: () => {\n CloudCmd.EditFileVim.show();\n },\n copy: () => {\n Buffer.copy();\n unselectFiles();\n },\n select: () => {\n const current = Info.element;\n toggleSelectedFile(current);\n },\n paste: Buffer.paste,\n moveNext: ({\n count,\n isVisual,\n isDelete\n }) => {\n setCurrent('next', {\n count,\n isVisual,\n isDelete\n }, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n });\n },\n movePrevious: ({\n count,\n isVisual,\n isDelete\n }) => {\n setCurrent('previous', {\n count,\n isVisual,\n isDelete\n }, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n });\n },\n find: async () => {\n event.preventDefault();\n const [, value] = await Dialog.prompt('Find', '');\n if (!value) return;\n const names = Info.files.map(getCurrentName);\n const [result] = finder.find(value, names);\n setCurrentByName(result);\n },\n findNext: () => {\n const name = finder.findNext();\n setCurrentByName(name);\n },\n findPrevious: () => {\n const name = finder.findPrevious();\n setCurrentByName(name);\n }\n };\n};\nmodule.exports.selectFile = selectFileNotParent;\n\n//# sourceURL=file://cloudcmd/client/key/vim/index.js");
251
+
252
+ /***/ }),
253
+
254
+ /***/ "./client/key/vim/set-current.js":
255
+ /*!***************************************!*\
256
+ !*** ./client/key/vim/set-current.js ***!
257
+ \***************************************/
258
+ /*! no static exports found */
259
+ /***/ (function(module, exports, __webpack_require__) {
260
+
261
+ "use strict";
262
+ eval("\n\n/* global DOM */\nmodule.exports.selectFileNotParent = selectFileNotParent;\nfunction selectFileNotParent(current, {\n getCurrentName,\n selectFile\n} = DOM) {\n const name = getCurrentName(current);\n if (name === '..') return;\n selectFile(current);\n}\nmodule.exports.setCurrent = (sibling, {\n count,\n isVisual,\n isDelete\n}, {\n Info,\n setCurrentFile,\n unselectFiles,\n Operation\n}) => {\n let current = Info.element;\n const select = isVisual ? selectFileNotParent : unselectFiles;\n select(current);\n const position = `${sibling}Sibling`;\n for (let i = 0; i < count; i++) {\n const next = current[position];\n if (!next) break;\n current = next;\n select(current);\n }\n setCurrentFile(current);\n if (isDelete) Operation.show('delete');\n};\n\n//# sourceURL=file://cloudcmd/client/key/vim/set-current.js");
251
263
 
252
264
  /***/ }),
253
265
 
@@ -331,7 +343,7 @@ eval("\n\n/* global CloudCmd */\nconst DOM = __webpack_require__(/*! ./dom */ \"
331
343
  /***/ (function(module, exports, __webpack_require__) {
332
344
 
333
345
  "use strict";
334
- eval("\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nmodule.exports.registerSW = registerSW;\nmodule.exports.unregisterSW = unregisterSW;\nmodule.exports.listenSW = (sw, ...args) => {\n sw === null || sw === void 0 ? void 0 : sw.addEventListener(...args);\n};\nasync function registerSW(prefix) {\n if (!navigator.serviceWorker) return;\n const isHTTPS = location.protocol === 'https:';\n const isLocalhost = location.hostname === 'localhost';\n if (!isHTTPS && !isLocalhost) return;\n const {\n serviceWorker\n } = navigator;\n const register = serviceWorker.register.bind(serviceWorker);\n const [e, sw] = await tryToCatch(register, `${prefix}/sw.js`);\n if (e) return null;\n return sw;\n}\nasync function unregisterSW(prefix) {\n const reg = await registerSW(prefix);\n reg === null || reg === void 0 ? void 0 : reg.unregister(prefix);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/register.js");
346
+ eval("\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nmodule.exports.registerSW = registerSW;\nmodule.exports.unregisterSW = unregisterSW;\nmodule.exports.listenSW = (sw, ...args) => {\n sw === null || sw === void 0 || sw.addEventListener(...args);\n};\nasync function registerSW(prefix) {\n if (!navigator.serviceWorker) return;\n const isHTTPS = location.protocol === 'https:';\n const isLocalhost = location.hostname === 'localhost';\n if (!isHTTPS && !isLocalhost) return;\n const {\n serviceWorker\n } = navigator;\n const register = serviceWorker.register.bind(serviceWorker);\n const [e, sw] = await tryToCatch(register, `${prefix}/sw.js`);\n if (e) return null;\n return sw;\n}\nasync function unregisterSW(prefix) {\n const reg = await registerSW(prefix);\n reg === null || reg === void 0 || reg.unregister(prefix);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/register.js");
335
347
 
336
348
  /***/ }),
337
349
 
@@ -18,4 +18,3 @@
18
18
  float: right;
19
19
  width: 19%;
20
20
  }
21
-
@@ -1,7 +1,7 @@
1
1
  .config {
2
2
  white-space: normal;
3
3
  overflow: hidden;
4
- width : 250px;
4
+ width: 250px;
5
5
  }
6
6
 
7
7
  .list li {
@@ -23,10 +23,18 @@
23
23
  -webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%);
24
24
  -moz-box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%);
25
25
  box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%);
26
- -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
27
- -moz-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
28
- -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
29
- transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
26
+ -webkit-transition:
27
+ border-color ease-in-out 0.15s,
28
+ box-shadow ease-in-out 0.15s;
29
+ -moz-transition:
30
+ border-color ease-in-out 0.15s,
31
+ box-shadow ease-in-out 0.15s;
32
+ -o-transition:
33
+ border-color ease-in-out 0.15s,
34
+ box-shadow ease-in-out 0.15s;
35
+ transition:
36
+ border-color ease-in-out 0.15s,
37
+ box-shadow ease-in-out 0.15s;
30
38
  }
31
39
 
32
40
  .config .form-control::-moz-placeholder {
@@ -44,9 +52,15 @@
44
52
  .config .form-control:focus {
45
53
  border-color: #66afe9;
46
54
  outline: 0;
47
- -webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%), 0 0 1px rgb(102 175 233 / 60%);
48
- -moz-box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%), 0 0 1px rgb(102 175 233 / 60%);
49
- box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%), 0 0 1px rgb(102 175 233 / 60%);
55
+ -webkit-box-shadow:
56
+ inset 0 1px 1px rgb(0 0 0 / 7.5%),
57
+ 0 0 1px rgb(102 175 233 / 60%);
58
+ -moz-box-shadow:
59
+ inset 0 1px 1px rgb(0 0 0 / 7.5%),
60
+ 0 0 1px rgb(102 175 233 / 60%);
61
+ box-shadow:
62
+ inset 0 1px 1px rgb(0 0 0 / 7.5%),
63
+ 0 0 1px rgb(102 175 233 / 60%);
50
64
  }
51
65
 
52
66
  .config .form-control:focus:invalid:focus {
@@ -57,8 +71,8 @@
57
71
  }
58
72
 
59
73
  .config .list {
60
- padding : 0;
61
- margin : 5%;
74
+ padding: 0;
75
+ margin: 5%;
62
76
  }
63
77
 
64
78
  .config .full-width {
package/dist-dev/nojs.css CHANGED
@@ -1,4 +1,5 @@
1
- .path-icon, .keyspanel {
1
+ .path-icon,
2
+ .keyspanel {
2
3
  display: none;
3
4
  }
4
5
 
package/dist-dev/sw.js CHANGED
@@ -101,7 +101,7 @@ var serviceWorkerOption = {
101
101
  /***/ (function(module, exports, __webpack_require__) {
102
102
 
103
103
  "use strict";
104
- eval("\n\nconst process = __webpack_require__(/*! process */ \"./node_modules/process/browser.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\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 = \"Mon Dec 04 2023 20:40: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};\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await self.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 self.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/client/sw/sw.js");
104
+ eval("\n\nconst process = __webpack_require__(/*! process */ \"./node_modules/process/browser.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\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 = \"Tue Dec 12 2023 16:11:30 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};\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await self.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 self.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/client/sw/sw.js");
105
105
 
106
106
  /***/ }),
107
107
 
@@ -1,4 +1,3 @@
1
1
  .terminal {
2
2
  height: 100%;
3
3
  }
4
-
@@ -21,4 +21,3 @@
21
21
  border: 0;
22
22
  overflow: auto;
23
23
  }
24
-
package/dist-dev/view.css CHANGED
@@ -15,11 +15,12 @@
15
15
  }
16
16
 
17
17
  .view-overlay {
18
- display : block;
19
- background : rgb(255 255 255 / 10%);
18
+ display: block;
19
+ background: rgb(255 255 255 / 10%);
20
20
  }
21
21
 
22
- .media, video {
22
+ .media,
23
+ video {
23
24
  width: 100%;
24
25
  }
25
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "16.17.9",
3
+ "version": "17.0.0",
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",
@@ -86,7 +86,7 @@
86
86
  "subdomain": "cloudcmd",
87
87
  "dependencies": {
88
88
  "@babel/core": "^7.22.9",
89
- "@babel/plugin-proposal-optional-chaining": "^7.21.0",
89
+ "@babel/plugin-transform-optional-chaining": "^7.21.0",
90
90
  "@cloudcmd/dropbox": "^4.0.1",
91
91
  "@cloudcmd/fileop": "^7.0.0",
92
92
  "@cloudcmd/move-files": "^7.0.0",
@@ -108,7 +108,7 @@
108
108
  "execon": "^1.2.0",
109
109
  "express": "^4.13.0",
110
110
  "files-io": "^4.0.0",
111
- "find-up": "^6.1.0",
111
+ "find-up": "^7.0.0",
112
112
  "for-each-key": "^2.0.0",
113
113
  "format-io": "^2.0.0",
114
114
  "fullstore": "^3.0.0",
@@ -118,7 +118,7 @@
118
118
  "jju": "^1.3.0",
119
119
  "jonny": "^3.0.0",
120
120
  "just-snake-case": "^1.1.0",
121
- "markdown-it": "^13.0.1",
121
+ "markdown-it": "^14.0.0",
122
122
  "mellow": "^3.0.0",
123
123
  "nomine": "^4.0.0",
124
124
  "object.omit": "^3.0.0",
@@ -128,7 +128,7 @@
128
128
  "package-json": "^8.1.0",
129
129
  "ponse": "^7.0.0",
130
130
  "pullout": "^4.0.0",
131
- "putout": "^33.13.3",
131
+ "putout": "^34.0.7",
132
132
  "redzip": "^3.0.0",
133
133
  "rendy": "^4.1.3",
134
134
  "restafary": "^11.0.0",
@@ -156,7 +156,7 @@
156
156
  "@cloudcmd/modal": "^3.0.0",
157
157
  "@cloudcmd/olark": "^3.0.2",
158
158
  "@cloudcmd/stub": "^4.0.1",
159
- "@putout/babel": "^1.0.5",
159
+ "@putout/babel": "^2.0.0",
160
160
  "auto-globals": "^3.0.0",
161
161
  "babel-loader": "^8.0.0",
162
162
  "babel-plugin-macros": "^3.0.0",
@@ -170,7 +170,7 @@
170
170
  "emitify": "^4.0.1",
171
171
  "eslint": "^8.0.1",
172
172
  "eslint-plugin-n": "^16.0.1",
173
- "eslint-plugin-putout": "^21.0.2",
173
+ "eslint-plugin-putout": "^22.0.0",
174
174
  "extract-text-webpack-plugin": "^4.0.0-alpha.0",
175
175
  "gritty": "^7.0.0",
176
176
  "gunzip-maybe": "^1.3.1",
@@ -181,7 +181,7 @@
181
181
  "just-pascal-case": "^1.1.0",
182
182
  "limier": "^3.0.0",
183
183
  "load.js": "^3.0.0",
184
- "madrun": "^9.0.0",
184
+ "madrun": "^10.0.0",
185
185
  "memfs": "^4.2.0",
186
186
  "minor": "^1.2.2",
187
187
  "mock-require": "^3.0.1",
@@ -189,7 +189,7 @@
189
189
  "multi-rename": "^2.0.0",
190
190
  "nodemon": "^3.0.1",
191
191
  "optimize-css-assets-webpack-plugin": "^5.0.0",
192
- "philip": "^2.0.0",
192
+ "philip": "^3.0.0",
193
193
  "place": "^1.1.4",
194
194
  "readjson": "^2.0.1",
195
195
  "request": "^2.76.0",
@@ -200,7 +200,7 @@
200
200
  "smalltalk": "^4.0.0",
201
201
  "style-loader": "^2.0.0",
202
202
  "supermenu": "^4.0.1",
203
- "supertape": "^8.1.0",
203
+ "supertape": "^9.0.0",
204
204
  "tar-stream": "^3.0.0",
205
205
  "unionfs": "^4.0.0",
206
206
  "url-loader": "^4.0.0",
@@ -210,7 +210,7 @@
210
210
  "webpackbar": "^5.0.0-3"
211
211
  },
212
212
  "engines": {
213
- "node": ">=16"
213
+ "node": ">=18"
214
214
  },
215
215
  "license": "MIT",
216
216
  "main": "server/cloudcmd.js",
package/server/route.js CHANGED
@@ -19,9 +19,7 @@ const {contentType} = require('mime-types');
19
19
  const root = require(`${DIR_SERVER}root`);
20
20
  const prefixer = require(`${DIR_SERVER}prefixer`);
21
21
  const CloudFunc = require(`${DIR_COMMON}cloudfunc`);
22
-
23
22
  const Columns = require(`${DIR_SERVER}/columns`);
24
-
25
23
  const Template = require(`${DIR_SERVER}/template`);
26
24
 
27
25
  const {FS} = CloudFunc;
@@ -22,56 +22,56 @@ const DEFAULT_MENU_PATH = join(__dirname, '../static/user-menu.js');
22
22
  module.exports = currify(async ({menuName}, req, res, next) => {
23
23
  if (req.url.indexOf(URL))
24
24
  return next();
25
-
25
+
26
26
  const {method} = req;
27
-
27
+
28
28
  if (method === 'GET')
29
29
  return await onGET({
30
30
  req,
31
31
  res,
32
32
  menuName,
33
33
  });
34
-
34
+
35
35
  next();
36
36
  });
37
37
 
38
38
  async function onGET({req, res, menuName}) {
39
39
  const {dir} = req.query;
40
40
  const url = req.url.replace(URL, '');
41
-
41
+
42
42
  if (url === '/default')
43
43
  return sendDefaultMenu(res);
44
-
44
+
45
45
  const {findUp} = await import('find-up');
46
-
46
+
47
47
  const [errorFind, currentMenuPath] = await tryToCatch(findUp, [menuName], {
48
48
  cwd: dir,
49
49
  });
50
-
50
+
51
51
  if (errorFind && errorFind.code !== 'ENOENT')
52
52
  return res
53
53
  .status(404)
54
54
  .send(errorFind.message);
55
-
55
+
56
56
  const homeMenuPath = join(homedir(), menuName);
57
57
  const menuPath = currentMenuPath || homeMenuPath;
58
58
  const [e, source] = await tryToCatch(readFile, menuPath, 'utf8');
59
-
59
+
60
60
  if (e && e.code !== 'ENOENT')
61
61
  return res
62
62
  .status(404)
63
63
  .send(e.message);
64
-
64
+
65
65
  if (e)
66
66
  return sendDefaultMenu(res);
67
-
67
+
68
68
  const [parseError, result] = await transpile(source);
69
-
69
+
70
70
  if (parseError)
71
71
  return res
72
72
  .type('js')
73
73
  .send(getError(parseError, source));
74
-
74
+
75
75
  res
76
76
  .type('js')
77
77
  .send(result.code);
@@ -84,9 +84,9 @@ function getError(error, source) {
84
84
  source,
85
85
  highlightCode: false,
86
86
  })}</pre>\`);
87
-
87
+
88
88
  e.code = 'frame';
89
-
89
+
90
90
  throw e;
91
91
  `;
92
92
  }
@@ -104,7 +104,6 @@ async function transpile(source) {
104
104
  },
105
105
  plugins: [
106
106
  'nodejs',
107
- 'strict-mode',
108
107
  'cloudcmd',
109
108
  ],
110
109
  });