cloudcmd 17.4.0 → 17.4.2
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/CONTRIBUTING.md +2 -2
- package/ChangeLog +16 -0
- package/HELP.md +3 -1
- package/README.md +1 -1
- package/bin/release.mjs +1 -1
- 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/config.js +1 -1
- package/dist/modules/config.js.map +1 -1
- package/dist/modules/edit-names.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist-dev/cloudcmd.common.js +13 -13
- package/dist-dev/cloudcmd.js +4 -4
- package/dist-dev/modules/config.js +1 -1
- package/dist-dev/modules/edit-names.js +1 -1
- package/dist-dev/sw.js +1 -1
- package/package.json +8 -8
- package/server/columns.spec.mjs +1 -1
- package/server/distribute/export.spec.mjs +1 -1
- package/server/distribute/import.mjs +1 -1
- package/server/distribute/import.spec.mjs +1 -1
- package/server/terminal.js +5 -1
- package/server/themes.spec.mjs +1 -1
- package/server/user-menu.spec.mjs +1 -1
- package/server/validate.mjs +18 -3
package/dist-dev/sw.js
CHANGED
|
@@ -103,7 +103,7 @@ var serviceWorkerOption = {
|
|
|
103
103
|
/***/ (function(module, exports, __webpack_require__) {
|
|
104
104
|
|
|
105
105
|
"use strict";
|
|
106
|
-
eval("\n\nconst process = __webpack_require__(/*! node: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 = \"Wed
|
|
106
|
+
eval("\n\nconst process = __webpack_require__(/*! node: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 = \"Wed Jul 03 2024 16:09:34 GMT+0300 (Eastern European Summer 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");
|
|
107
107
|
|
|
108
108
|
/***/ }),
|
|
109
109
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcmd",
|
|
3
|
-
"version": "17.4.
|
|
3
|
+
"version": "17.4.2",
|
|
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",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@babel/plugin-transform-optional-chaining": "^7.21.0",
|
|
91
91
|
"@cloudcmd/dropbox": "^5.0.1",
|
|
92
92
|
"@cloudcmd/fileop": "^8.0.0",
|
|
93
|
-
"@cloudcmd/move-files": "^
|
|
93
|
+
"@cloudcmd/move-files": "^8.0.0",
|
|
94
94
|
"@cloudcmd/read-files-sync": "^2.0.0",
|
|
95
95
|
"@putout/cli-validate-args": "^1.0.1",
|
|
96
96
|
"@putout/plugin-cloudcmd": "^3.1.1",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"chalk": "^4.0.0",
|
|
99
99
|
"compression": "^1.7.4",
|
|
100
100
|
"console-io": "^14.0.0",
|
|
101
|
-
"copymitter": "^
|
|
101
|
+
"copymitter": "^9.0.0",
|
|
102
102
|
"criton": "^2.0.0",
|
|
103
103
|
"currify": "^4.0.0",
|
|
104
104
|
"deepmerge": "^4.0.0",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"jaguar": "^6.0.0",
|
|
119
119
|
"jju": "^1.3.0",
|
|
120
120
|
"jonny": "^3.0.0",
|
|
121
|
-
"just-snake-case": "^
|
|
121
|
+
"just-snake-case": "^3.2.0",
|
|
122
122
|
"markdown-it": "^14.0.0",
|
|
123
123
|
"mellow": "^3.0.0",
|
|
124
124
|
"nano-memoize": "^3.0.16",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"once": "^1.4.0",
|
|
128
128
|
"onezip": "^6.0.1",
|
|
129
129
|
"open": "^10.0.3",
|
|
130
|
-
"package-json": "^
|
|
130
|
+
"package-json": "^10.0.0",
|
|
131
131
|
"ponse": "^7.0.0",
|
|
132
132
|
"pullout": "^5.0.0",
|
|
133
133
|
"putout": "^35.0.0",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"auto-globals": "^4.0.0",
|
|
164
164
|
"babel-loader": "^8.0.0",
|
|
165
165
|
"babel-plugin-macros": "^3.0.0",
|
|
166
|
-
"c8": "^
|
|
166
|
+
"c8": "^10.1.2",
|
|
167
167
|
"cheerio": "^1.0.0-rc.5",
|
|
168
168
|
"clean-css-loader": "^2.0.0",
|
|
169
169
|
"codegen.macro": "^4.0.0",
|
|
@@ -180,8 +180,8 @@
|
|
|
180
180
|
"html-looks-like": "^1.0.2",
|
|
181
181
|
"html-webpack-plugin": "^4.0.1",
|
|
182
182
|
"inherits": "^2.0.3",
|
|
183
|
-
"just-capitalize": "^
|
|
184
|
-
"just-pascal-case": "^
|
|
183
|
+
"just-capitalize": "^3.2.0",
|
|
184
|
+
"just-pascal-case": "^3.2.0",
|
|
185
185
|
"limier": "^3.0.0",
|
|
186
186
|
"load.js": "^3.0.0",
|
|
187
187
|
"madrun": "^10.0.0",
|
package/server/columns.spec.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {dirname} from 'node:path';
|
|
2
2
|
import {fileURLToPath} from 'node:url';
|
|
3
|
-
import test from 'supertape';
|
|
4
3
|
import fs from 'node:fs';
|
|
4
|
+
import test from 'supertape';
|
|
5
5
|
import {getColumns, isDev} from './columns.mjs';
|
|
6
6
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Config from '../config.js';
|
|
2
1
|
import {once} from 'node:events';
|
|
3
2
|
import test from 'supertape';
|
|
4
3
|
import io from 'socket.io-client';
|
|
4
|
+
import Config from '../config.js';
|
|
5
5
|
import {connect} from '../../test/before.mjs';
|
|
6
6
|
|
|
7
7
|
const config = Config.createConfig();
|
|
@@ -3,9 +3,9 @@ import wraptile from 'wraptile';
|
|
|
3
3
|
import squad from 'squad';
|
|
4
4
|
import fullstore from 'fullstore';
|
|
5
5
|
import io from 'socket.io-client';
|
|
6
|
+
import _forEachKey from 'for-each-key';
|
|
6
7
|
import log from './log.mjs';
|
|
7
8
|
import env from '../env.js';
|
|
8
|
-
import _forEachKey from 'for-each-key';
|
|
9
9
|
|
|
10
10
|
const noop = () => {};
|
|
11
11
|
const forEachKey = currify(_forEachKey);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
|
-
import test from 'supertape';
|
|
3
2
|
import {promisify} from 'node:util';
|
|
3
|
+
import test from 'supertape';
|
|
4
4
|
import tryToCatch from 'try-to-catch';
|
|
5
5
|
import {connect} from '../../test/before.mjs';
|
|
6
6
|
import {createConfigManager} from '../cloudcmd.mjs';
|
package/server/terminal.js
CHANGED
|
@@ -12,7 +12,11 @@ function _getModule(a) {
|
|
|
12
12
|
return require(a);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
module.exports = (config, arg,
|
|
15
|
+
module.exports = (config, arg, overrides = {}) => {
|
|
16
|
+
const {
|
|
17
|
+
getModule = _getModule,
|
|
18
|
+
} = overrides;
|
|
19
|
+
|
|
16
20
|
if (!config('terminal'))
|
|
17
21
|
return noop;
|
|
18
22
|
|
package/server/themes.spec.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {dirname} from 'node:path';
|
|
2
2
|
import {fileURLToPath} from 'node:url';
|
|
3
|
-
import test from 'supertape';
|
|
4
3
|
import fs from 'node:fs';
|
|
4
|
+
import test from 'supertape';
|
|
5
5
|
import {getThemes, isDev} from './theme.mjs';
|
|
6
6
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {dirname, join} from 'node:path';
|
|
2
2
|
import {fileURLToPath} from 'node:url';
|
|
3
|
+
import {readFileSync} from 'node:fs';
|
|
3
4
|
import {test, stub} from 'supertape';
|
|
4
5
|
import serveOnce from 'serve-once';
|
|
5
6
|
import threadIt from 'thread-it';
|
|
6
7
|
import userMenu from './user-menu.mjs';
|
|
7
|
-
import {readFileSync} from 'node:fs';
|
|
8
8
|
|
|
9
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
10
10
|
const __dirname = dirname(__filename);
|
package/server/validate.mjs
CHANGED
|
@@ -6,7 +6,12 @@ import {getThemes as _getThemes} from './theme.mjs';
|
|
|
6
6
|
|
|
7
7
|
const isString = (a) => typeof a === 'string';
|
|
8
8
|
|
|
9
|
-
export const root = (dir, config,
|
|
9
|
+
export const root = (dir, config, overrides = {}) => {
|
|
10
|
+
const {
|
|
11
|
+
exit = _exit,
|
|
12
|
+
statSync = _statSync,
|
|
13
|
+
} = overrides;
|
|
14
|
+
|
|
10
15
|
if (!isString(dir))
|
|
11
16
|
throw Error('dir should be a string');
|
|
12
17
|
|
|
@@ -36,7 +41,12 @@ export const packer = (name, {exit = _exit} = {}) => {
|
|
|
36
41
|
exit('cloudcmd --packer: could be "tar" or "zip" only');
|
|
37
42
|
};
|
|
38
43
|
|
|
39
|
-
export const columns = (type,
|
|
44
|
+
export const columns = (type, overrides = {}) => {
|
|
45
|
+
const {
|
|
46
|
+
exit = _exit,
|
|
47
|
+
getColumns = _getColumns,
|
|
48
|
+
} = overrides;
|
|
49
|
+
|
|
40
50
|
const addQuotes = (a) => `"${a}"`;
|
|
41
51
|
const all = Object
|
|
42
52
|
.keys(getColumns())
|
|
@@ -51,7 +61,12 @@ export const columns = (type, {exit = _exit, getColumns = _getColumns} = {}) =>
|
|
|
51
61
|
exit(`cloudcmd --columns: can be only one of: ${names}`);
|
|
52
62
|
};
|
|
53
63
|
|
|
54
|
-
export const theme = (type,
|
|
64
|
+
export const theme = (type, overrides = {}) => {
|
|
65
|
+
const {
|
|
66
|
+
exit = _exit,
|
|
67
|
+
getThemes = _getThemes,
|
|
68
|
+
} = overrides;
|
|
69
|
+
|
|
55
70
|
const addQuotes = (a) => `"${a}"`;
|
|
56
71
|
const all = Object
|
|
57
72
|
.keys(getThemes())
|