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.
- package/ChangeLog +18 -0
- package/HELP.md +3 -1
- package/README.md +1 -1
- package/dist/cloudcmd.common.js +3 -3
- package/dist/cloudcmd.common.js.map +1 -1
- package/dist/cloudcmd.css +1 -1
- package/dist/cloudcmd.js +1 -1
- package/dist/cloudcmd.js.map +1 -1
- package/dist/modules/cloud.js +1 -1
- package/dist/modules/cloud.js.map +1 -1
- package/dist/modules/command-line.js +1 -1
- package/dist/modules/command-line.js.map +1 -1
- package/dist/modules/config.js +1 -1
- package/dist/modules/config.js.map +1 -1
- package/dist/modules/contact.js +1 -1
- package/dist/modules/contact.js.map +1 -1
- package/dist/modules/edit-file-vim.js +1 -1
- package/dist/modules/edit-file-vim.js.map +1 -1
- package/dist/modules/edit-file.js +1 -1
- package/dist/modules/edit-file.js.map +1 -1
- package/dist/modules/edit-names-vim.js +1 -1
- package/dist/modules/edit-names-vim.js.map +1 -1
- package/dist/modules/edit-names.js +1 -1
- package/dist/modules/edit-names.js.map +1 -1
- package/dist/modules/edit.js +1 -1
- package/dist/modules/edit.js.map +1 -1
- package/dist/modules/help.js +1 -1
- package/dist/modules/help.js.map +1 -1
- package/dist/modules/konsole.js +1 -1
- package/dist/modules/konsole.js.map +1 -1
- package/dist/modules/markdown.js +1 -1
- package/dist/modules/markdown.js.map +1 -1
- package/dist/modules/menu.js +1 -1
- package/dist/modules/menu.js.map +1 -1
- package/dist/modules/operation.js +1 -1
- package/dist/modules/operation.js.map +1 -1
- package/dist/modules/polyfill.js +1 -1
- package/dist/modules/polyfill.js.map +1 -1
- package/dist/modules/terminal-run.js +1 -1
- package/dist/modules/terminal-run.js.map +1 -1
- package/dist/modules/terminal.js +1 -1
- package/dist/modules/terminal.js.map +1 -1
- package/dist/modules/upload.js +1 -1
- package/dist/modules/upload.js.map +1 -1
- package/dist/modules/user-menu.js +1 -1
- package/dist/modules/user-menu.js.map +1 -1
- package/dist/modules/view.js +1 -1
- package/dist/modules/view.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist-dev/cloudcmd.common.js +11 -45
- package/dist-dev/cloudcmd.css +179 -160
- package/dist-dev/cloudcmd.js +14 -2
- package/dist-dev/columns/name-size-date.css +0 -1
- package/dist-dev/config.css +24 -10
- package/dist-dev/nojs.css +2 -1
- package/dist-dev/sw.js +1 -1
- package/dist-dev/terminal.css +0 -1
- package/dist-dev/user-menu.css +0 -1
- package/dist-dev/view.css +4 -3
- package/package.json +11 -11
- package/server/route.js +0 -2
- package/server/user-menu.js +15 -16
package/dist-dev/cloudcmd.js
CHANGED
|
@@ -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;\
|
|
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
|
|
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
|
|
package/dist-dev/config.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.config {
|
|
2
2
|
white-space: normal;
|
|
3
3
|
overflow: hidden;
|
|
4
|
-
width
|
|
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:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
transition:
|
|
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:
|
|
48
|
-
|
|
49
|
-
|
|
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
|
|
61
|
-
margin
|
|
74
|
+
padding: 0;
|
|
75
|
+
margin: 5%;
|
|
62
76
|
}
|
|
63
77
|
|
|
64
78
|
.config .full-width {
|
package/dist-dev/nojs.css
CHANGED
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 = \"
|
|
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
|
|
package/dist-dev/terminal.css
CHANGED
package/dist-dev/user-menu.css
CHANGED
package/dist-dev/view.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcmd",
|
|
3
|
-
"version": "
|
|
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-
|
|
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": "^
|
|
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": "^
|
|
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": "^
|
|
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": "^
|
|
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": "^
|
|
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": "^
|
|
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": "^
|
|
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": "^
|
|
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": ">=
|
|
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;
|
package/server/user-menu.js
CHANGED
|
@@ -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
|
});
|