cloudcmd 19.1.21 → 19.3.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 +22 -0
- package/HELP.md +3 -1
- package/README.md +1 -1
- package/bin/{cloudcmd.mjs → cloudcmd.js} +5 -5
- package/common/callbackify.js +1 -3
- package/common/datetime.js +2 -4
- package/common/try-to-promise-all.js +2 -3
- package/dist/cloudcmd.common.js +2 -2
- package/dist/cloudcmd.common.js.map +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/sw.js.map +1 -1
- package/dist-dev/cloudcmd.common.js +335 -366
- package/dist-dev/cloudcmd.js +1 -1
- package/dist-dev/modules/cloud.js +1 -1
- package/dist-dev/modules/command-line.js +1 -1
- package/dist-dev/modules/config.js +1 -1
- package/dist-dev/modules/edit.js +1 -1
- package/dist-dev/modules/konsole.js +1 -1
- package/dist-dev/modules/menu.js +1 -1
- package/dist-dev/modules/operation.js +1 -1
- package/dist-dev/modules/upload.js +1 -1
- package/dist-dev/modules/user-menu.js +1 -1
- package/dist-dev/modules/view.js +1 -1
- package/dist-dev/sw.js +6 -6
- package/package.json +17 -16
- package/server/auth.js +4 -5
- package/server/{cloudcmd.mjs → cloudcmd.js} +7 -7
- package/server/{config.mjs → config.js} +16 -24
- package/server/depstore.js +1 -3
- package/server/distribute/{export.mjs → export.js} +1 -1
- package/server/distribute/{import.mjs → import.js} +2 -2
- package/server/exit.js +2 -3
- package/server/markdown/index.js +12 -12
- package/server/markdown/worker.js +3 -3
- package/server/prefixer.js +1 -3
- package/server/repl.js +4 -6
- package/server/rest/info.js +7 -6
- package/server/root.js +2 -4
- package/server/{route.mjs → route.js} +2 -2
- package/server/{server.mjs → server.js} +1 -1
- package/server/show-config.js +3 -5
- package/server/template.js +6 -4
- package/server/terminal.js +4 -3
- package/server/{user-menu.mjs → user-menu.js} +19 -8
- package/server/{validate.mjs → validate.js} +2 -2
- package/static/user-menu.js +5 -5
- /package/common/{cloudfunc.mjs → cloudfunc.js} +0 -0
- /package/common/{entity.mjs → entity.js} +0 -0
- /package/common/{util.mjs → util.js} +0 -0
- /package/rules/{split-autoglobals-with-tape.mjs → split-autoglobals-with-tape.js} +0 -0
- /package/server/{columns.mjs → columns.js} +0 -0
- /package/server/distribute/{log.mjs → log.js} +0 -0
- /package/server/{env.mjs → env.js} +0 -0
- /package/server/{modulas.mjs → modulas.js} +0 -0
- /package/server/rest/{index.mjs → index.js} +0 -0
- /package/server/{theme.mjs → theme.js} +0 -0
package/dist-dev/cloudcmd.js
CHANGED
|
@@ -192,7 +192,7 @@ module.exports = import("https://esm.sh/@putout/processor-html");;
|
|
|
192
192
|
/******/ // startup
|
|
193
193
|
/******/ // Load entry module and return exports
|
|
194
194
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
|
195
|
-
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/cloudcmd.
|
|
195
|
+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/cloudcmd.js")))
|
|
196
196
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
|
197
197
|
/******/
|
|
198
198
|
/******/ })()
|
|
@@ -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/cloud.
|
|
173
|
+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/modules/cloud.js")))
|
|
174
174
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
|
175
175
|
/******/
|
|
176
176
|
/******/ })()
|
|
@@ -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/command-line.
|
|
173
|
+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/modules/command-line.js")))
|
|
174
174
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
|
175
175
|
/******/
|
|
176
176
|
/******/ })()
|
|
@@ -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.
|
|
173
|
+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/modules/config/index.js")))
|
|
174
174
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
|
175
175
|
/******/
|
|
176
176
|
/******/ })()
|
package/dist-dev/modules/edit.js
CHANGED
|
@@ -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/edit.
|
|
173
|
+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/modules/edit.js")))
|
|
174
174
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
|
175
175
|
/******/
|
|
176
176
|
/******/ })()
|
|
@@ -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/konsole.
|
|
173
|
+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/modules/konsole.js")))
|
|
174
174
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
|
175
175
|
/******/
|
|
176
176
|
/******/ })()
|
package/dist-dev/modules/menu.js
CHANGED
|
@@ -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/menu/index.
|
|
173
|
+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/modules/menu/index.js")))
|
|
174
174
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
|
175
175
|
/******/
|
|
176
176
|
/******/ })()
|
|
@@ -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/operation/index.
|
|
173
|
+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/modules/operation/index.js")))
|
|
174
174
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
|
175
175
|
/******/
|
|
176
176
|
/******/ })()
|
|
@@ -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/upload.
|
|
173
|
+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/modules/upload.js")))
|
|
174
174
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
|
175
175
|
/******/
|
|
176
176
|
/******/ })()
|
|
@@ -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/user-menu/index.
|
|
173
|
+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/modules/user-menu/index.js")))
|
|
174
174
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
|
175
175
|
/******/
|
|
176
176
|
/******/ })()
|
package/dist-dev/modules/view.js
CHANGED
|
@@ -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/view/index.
|
|
173
|
+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["cloudcmd.common"], () => (__webpack_require__("./client/modules/view/index.js")))
|
|
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.
|
|
13
|
-
|
|
14
|
-
!*** ./client/sw/sw.
|
|
15
|
-
|
|
12
|
+
/***/ "./client/sw/sw.js"
|
|
13
|
+
/*!*************************!*\
|
|
14
|
+
!*** ./client/sw/sw.js ***!
|
|
15
|
+
\*************************/
|
|
16
16
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
17
17
|
|
|
18
18
|
"use strict";
|
|
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 = \"
|
|
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 Feb 03 2026 15:53:49 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}");
|
|
20
20
|
|
|
21
21
|
/***/ },
|
|
22
22
|
|
|
@@ -118,7 +118,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
118
118
|
/******/ // startup
|
|
119
119
|
/******/ // Load entry module and return exports
|
|
120
120
|
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
121
|
-
/******/ var __webpack_exports__ = __webpack_require__("./client/sw/sw.
|
|
121
|
+
/******/ var __webpack_exports__ = __webpack_require__("./client/sw/sw.js");
|
|
122
122
|
/******/
|
|
123
123
|
/******/ })()
|
|
124
124
|
;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcmd",
|
|
3
|
-
"version": "19.
|
|
4
|
-
"type": "
|
|
3
|
+
"version": "19.3.0",
|
|
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",
|
|
7
7
|
"homepage": "http://cloudcmd.io",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/coderaiser/cloudcmd.git"
|
|
12
12
|
},
|
|
13
|
-
"main": "server/cloudcmd.
|
|
13
|
+
"main": "server/cloudcmd.js",
|
|
14
14
|
"keywords": [
|
|
15
15
|
"console",
|
|
16
16
|
"terminal",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"server"
|
|
40
40
|
],
|
|
41
41
|
"bin": {
|
|
42
|
-
"cloudcmd": "bin/cloudcmd.
|
|
42
|
+
"cloudcmd": "bin/cloudcmd.js"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"start": "madrun start",
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"@cloudcmd/stub": "^5.0.0",
|
|
161
161
|
"@iocmd/wait": "^2.1.0",
|
|
162
162
|
"@putout/eslint-flat": "^4.0.0",
|
|
163
|
-
"@putout/plugin-cloudcmd": "^
|
|
163
|
+
"@putout/plugin-cloudcmd": "^5.2.0",
|
|
164
164
|
"@types/node-fetch": "^2.6.11",
|
|
165
165
|
"auto-globals": "^4.0.0",
|
|
166
166
|
"babel-loader": "^10.0.0",
|
|
@@ -221,17 +221,18 @@
|
|
|
221
221
|
},
|
|
222
222
|
"imports": {
|
|
223
223
|
"#css/": "./css/",
|
|
224
|
-
"#dom
|
|
225
|
-
"#dom/
|
|
226
|
-
"#dom/
|
|
227
|
-
"#dom/
|
|
228
|
-
"#dom/
|
|
229
|
-
"#dom/
|
|
230
|
-
"#dom/
|
|
231
|
-
"#dom/
|
|
232
|
-
"#
|
|
233
|
-
"#common/
|
|
234
|
-
"#common/
|
|
224
|
+
"#dom": "./client/dom/index.js",
|
|
225
|
+
"#dom/events": "./client/dom/events/index.js",
|
|
226
|
+
"#dom/load": "./client/dom/load.js",
|
|
227
|
+
"#dom/dialog": "./client/dom/dialog.js",
|
|
228
|
+
"#dom/images": "./client/dom/images.js",
|
|
229
|
+
"#dom/files": "./client/dom/files.js",
|
|
230
|
+
"#dom/upload-files": "./client/dom/upload-files.js",
|
|
231
|
+
"#dom/storage": "./client/dom/storage.js",
|
|
232
|
+
"#dom/rest": "./client/dom/rest.js",
|
|
233
|
+
"#common/util": "./common/util.js",
|
|
234
|
+
"#common/cloudfunc": "./common/cloudfunc.js",
|
|
235
|
+
"#common/entity": "./common/entity.js"
|
|
235
236
|
},
|
|
236
237
|
"engines": {
|
|
237
238
|
"node": ">=22"
|
package/server/auth.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import httpAuth from 'http-auth';
|
|
2
|
+
import criton from 'criton';
|
|
3
|
+
import currify from 'currify';
|
|
2
4
|
|
|
3
|
-
const httpAuth = require('http-auth');
|
|
4
|
-
const criton = require('criton');
|
|
5
|
-
const currify = require('currify');
|
|
6
5
|
const middle = currify(_middle);
|
|
7
6
|
const check = currify(_check);
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
export default (config) => {
|
|
10
9
|
const auth = httpAuth.basic({
|
|
11
10
|
realm: 'Cloud Commander',
|
|
12
11
|
}, check(config));
|
|
@@ -16,15 +16,15 @@ import nomine from 'nomine';
|
|
|
16
16
|
import fileop from '@cloudcmd/fileop';
|
|
17
17
|
import * as cloudfunc from '#common/cloudfunc';
|
|
18
18
|
import authentication from './auth.js';
|
|
19
|
-
import {createConfig, configPath} from './config.
|
|
20
|
-
import modulas from './modulas.
|
|
21
|
-
import userMenu from './user-menu.
|
|
22
|
-
import rest from './rest/index.
|
|
23
|
-
import route from './route.
|
|
24
|
-
import * as validate from './validate.
|
|
19
|
+
import {createConfig, configPath} from './config.js';
|
|
20
|
+
import modulas from './modulas.js';
|
|
21
|
+
import {userMenu} from './user-menu.js';
|
|
22
|
+
import rest from './rest/index.js';
|
|
23
|
+
import route from './route.js';
|
|
24
|
+
import * as validate from './validate.js';
|
|
25
25
|
import prefixer from './prefixer.js';
|
|
26
26
|
import terminal from './terminal.js';
|
|
27
|
-
import {distributeExport} from './distribute/export.
|
|
27
|
+
import {distributeExport} from './distribute/export.js';
|
|
28
28
|
import {createDepStore} from './depstore.js';
|
|
29
29
|
|
|
30
30
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -1,32 +1,24 @@
|
|
|
1
|
+
import path, {dirname} from 'node:path';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import Emitter from 'node:events';
|
|
4
|
+
import {homedir} from 'node:os';
|
|
1
5
|
import {fileURLToPath} from 'node:url';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
6
|
+
import currify from 'currify';
|
|
7
|
+
import wraptile from 'wraptile';
|
|
8
|
+
import {tryToCatch} from 'try-to-catch';
|
|
9
|
+
import pullout from 'pullout';
|
|
10
|
+
import ponse from 'ponse';
|
|
11
|
+
import jonny from 'jonny';
|
|
12
|
+
import jju from 'jju';
|
|
13
|
+
import writejson from 'writejson';
|
|
14
|
+
import {tryCatch} from 'try-catch';
|
|
15
|
+
import criton from 'criton';
|
|
16
|
+
import * as CloudFunc from '#common/cloudfunc';
|
|
17
|
+
import exit from './exit.js';
|
|
4
18
|
|
|
5
19
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
20
|
const __dirname = dirname(__filename);
|
|
7
|
-
const require = createRequire(import.meta.url);
|
|
8
21
|
const DIR_SERVER = `${__dirname}/`;
|
|
9
|
-
|
|
10
|
-
const path = require('node:path');
|
|
11
|
-
|
|
12
|
-
const fs = require('node:fs');
|
|
13
|
-
const Emitter = require('node:events');
|
|
14
|
-
const {homedir} = require('node:os');
|
|
15
|
-
|
|
16
|
-
const currify = require('currify');
|
|
17
|
-
|
|
18
|
-
const wraptile = require('wraptile');
|
|
19
|
-
const {tryToCatch} = require('try-to-catch');
|
|
20
|
-
const pullout = require('pullout');
|
|
21
|
-
const ponse = require('ponse');
|
|
22
|
-
const jonny = require('jonny');
|
|
23
|
-
const jju = require('jju');
|
|
24
|
-
const writejson = require('writejson');
|
|
25
|
-
const {tryCatch} = require('try-catch');
|
|
26
|
-
const criton = require('criton');
|
|
27
|
-
const exit = require(`${DIR_SERVER}exit`);
|
|
28
|
-
|
|
29
|
-
const CloudFunc = require('../common/cloudfunc.mjs');
|
|
30
22
|
const isUndefined = (a) => typeof a === 'undefined';
|
|
31
23
|
const DIR = `${DIR_SERVER}../`;
|
|
32
24
|
const HOME = homedir();
|
package/server/depstore.js
CHANGED
|
@@ -4,8 +4,8 @@ import squad from 'squad';
|
|
|
4
4
|
import {fullstore} from 'fullstore';
|
|
5
5
|
import io from 'socket.io-client';
|
|
6
6
|
import _forEachKey from 'for-each-key';
|
|
7
|
-
import log from './log.
|
|
8
|
-
import * as env from '../env.
|
|
7
|
+
import log from './log.js';
|
|
8
|
+
import * as env from '../env.js';
|
|
9
9
|
|
|
10
10
|
const noop = () => {};
|
|
11
11
|
const forEachKey = currify(_forEachKey);
|
package/server/exit.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import process from 'node:process';
|
|
2
2
|
|
|
3
|
-
const process = require('node:process');
|
|
4
3
|
const getMessage = (a) => a?.message || a;
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
export default (...args) => {
|
|
7
6
|
const messages = args.map(getMessage);
|
|
8
7
|
|
|
9
8
|
console.error(...messages);
|
package/server/markdown/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
1
|
+
import {callbackify} from 'node:util';
|
|
2
|
+
import {fileURLToPath} from 'node:url';
|
|
3
|
+
import {dirname} from 'node:path';
|
|
4
|
+
import pullout from 'pullout';
|
|
5
|
+
import ponse from 'ponse';
|
|
6
|
+
import {read} from 'redzip';
|
|
7
|
+
import root from '../root.js';
|
|
8
|
+
import parse from './worker.js';
|
|
9
|
+
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = dirname(__filename);
|
|
12
12
|
const isString = (a) => typeof a === 'string';
|
|
13
13
|
|
|
14
14
|
// warm up
|
|
@@ -16,7 +16,7 @@ parse('');
|
|
|
16
16
|
|
|
17
17
|
const DIR_ROOT = `${__dirname}/../../`;
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
export default callbackify(async (name, rootDir, request) => {
|
|
20
20
|
check(name, request);
|
|
21
21
|
|
|
22
22
|
const {method} = request;
|
package/server/prefixer.js
CHANGED
package/server/repl.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import net from 'node:net';
|
|
3
|
+
import repl from 'node:repl';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
const net = require('node:net');
|
|
5
|
-
const repl = require('node:repl');
|
|
6
|
-
|
|
7
|
-
module.exports = net
|
|
5
|
+
export default net
|
|
8
6
|
.createServer((socket) => {
|
|
9
7
|
const {pid} = process;
|
|
10
8
|
const addr = socket.remoteAddress;
|
package/server/rest/info.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import format from 'format-io';
|
|
3
|
+
import info from '../../package.json' with {
|
|
4
|
+
type: 'json',
|
|
5
|
+
};
|
|
5
6
|
|
|
6
|
-
const {version} =
|
|
7
|
+
const {version} = info;
|
|
7
8
|
|
|
8
9
|
const getMemory = () => {
|
|
9
10
|
const {rss} = process.memoryUsage();
|
|
10
11
|
return format.size(rss);
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
export default (prefix) => ({
|
|
14
15
|
version,
|
|
15
16
|
prefix,
|
|
16
17
|
memory: getMemory(),
|
package/server/root.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import mellow from 'mellow';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
module.exports = (dir, root, {webToWin = mellow.webToWin} = {}) => {
|
|
3
|
+
export default (dir, root, {webToWin = mellow.webToWin} = {}) => {
|
|
6
4
|
return webToWin(dir, root || '/');
|
|
7
5
|
};
|
|
@@ -14,8 +14,8 @@ import * as CloudFunc from '#common/cloudfunc';
|
|
|
14
14
|
import root from './root.js';
|
|
15
15
|
import prefixer from './prefixer.js';
|
|
16
16
|
import Template from './template.js';
|
|
17
|
-
import {getColumns} from './columns.
|
|
18
|
-
import {getThemes} from './theme.
|
|
17
|
+
import {getColumns} from './columns.js';
|
|
18
|
+
import {getThemes} from './theme.js';
|
|
19
19
|
|
|
20
20
|
const require = createRequire(import.meta.url);
|
|
21
21
|
const {stringify} = JSON;
|
|
@@ -11,7 +11,7 @@ import tryRequire from 'tryrequire';
|
|
|
11
11
|
import wraptile from 'wraptile';
|
|
12
12
|
import compression from 'compression';
|
|
13
13
|
import exit from './exit.js';
|
|
14
|
-
import cloudcmd from './cloudcmd.
|
|
14
|
+
import cloudcmd from './cloudcmd.js';
|
|
15
15
|
|
|
16
16
|
const bind = (f, self) => f.bind(self);
|
|
17
17
|
|
package/server/show-config.js
CHANGED
package/server/template.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import path, {dirname} from 'node:path';
|
|
2
|
+
import {fileURLToPath} from 'node:url';
|
|
3
|
+
import readFilesSync from '@cloudcmd/read-files-sync';
|
|
2
4
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = dirname(__filename);
|
|
5
7
|
const templatePath = path.join(__dirname, '..', 'tmpl/fs');
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
export default readFilesSync(templatePath, 'utf8');
|
package/server/terminal.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import {createRequire} from 'node:module';
|
|
2
|
+
import {tryCatch} from 'try-catch';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
4
5
|
|
|
5
6
|
const noop = (req, res, next) => {
|
|
6
7
|
next && next();
|
|
@@ -10,7 +11,7 @@ noop.listen = noop;
|
|
|
10
11
|
|
|
11
12
|
const _getModule = (a) => require(a);
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
export default (config, arg, overrides = {}) => {
|
|
14
15
|
const {
|
|
15
16
|
getModule = _getModule,
|
|
16
17
|
} = overrides;
|
|
@@ -1,6 +1,8 @@
|
|
|
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
|
+
// warm up worker cache
|
|
4
6
|
import montag from 'montag';
|
|
5
7
|
import {tryToCatch} from 'try-to-catch';
|
|
6
8
|
import currify from 'currify';
|
|
@@ -10,9 +12,8 @@ import {putout, codeframe} from 'putout';
|
|
|
10
12
|
transpile('');
|
|
11
13
|
|
|
12
14
|
const PREFIX = '/api/v1/user-menu';
|
|
13
|
-
const DEFAULT_MENU_PATH = new URL('../static/user-menu.js', import.meta.url).pathname;
|
|
14
15
|
|
|
15
|
-
export
|
|
16
|
+
export const userMenu = currify(async ({menuName, readFile = _readFile}, req, res, next) => {
|
|
16
17
|
if (!req.url.startsWith(PREFIX))
|
|
17
18
|
return next();
|
|
18
19
|
|
|
@@ -34,7 +35,7 @@ async function onGET({req, res, menuName, readFile}) {
|
|
|
34
35
|
const url = req.url.replace(PREFIX, '');
|
|
35
36
|
|
|
36
37
|
if (url === '/default')
|
|
37
|
-
return sendDefaultMenu(res);
|
|
38
|
+
return await sendDefaultMenu(res);
|
|
38
39
|
|
|
39
40
|
const {findUp} = await import('find-up');
|
|
40
41
|
|
|
@@ -57,7 +58,7 @@ async function onGET({req, res, menuName, readFile}) {
|
|
|
57
58
|
.send(e.message);
|
|
58
59
|
|
|
59
60
|
if (e)
|
|
60
|
-
return sendDefaultMenu(res);
|
|
61
|
+
return await sendDefaultMenu(res);
|
|
61
62
|
|
|
62
63
|
const [parseError, result] = await transpile(source);
|
|
63
64
|
|
|
@@ -85,10 +86,12 @@ function getError(error, source) {
|
|
|
85
86
|
`;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
function sendDefaultMenu(res) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
async function sendDefaultMenu(res) {
|
|
90
|
+
const menu = await getDefaultMenu();
|
|
91
|
+
|
|
92
|
+
res
|
|
93
|
+
.type('js')
|
|
94
|
+
.send(menu);
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
async function transpile(source) {
|
|
@@ -102,3 +105,11 @@ async function transpile(source) {
|
|
|
102
105
|
],
|
|
103
106
|
});
|
|
104
107
|
}
|
|
108
|
+
|
|
109
|
+
async function getDefaultMenu() {
|
|
110
|
+
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);
|
|
113
|
+
|
|
114
|
+
return result.code;
|
|
115
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {statSync as _statSync} from 'node:fs';
|
|
2
2
|
import {tryCatch} from 'try-catch';
|
|
3
3
|
import _exit from './exit.js';
|
|
4
|
-
import {getColumns as _getColumns} from './columns.
|
|
5
|
-
import {getThemes as _getThemes} from './theme.
|
|
4
|
+
import {getColumns as _getColumns} from './columns.js';
|
|
5
|
+
import {getThemes as _getThemes} from './theme.js';
|
|
6
6
|
|
|
7
7
|
const isString = (a) => typeof a === 'string';
|
|
8
8
|
|