cloudcmd 16.15.0 → 16.16.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 (52) hide show
  1. package/CONTRIBUTING.md +6 -6
  2. package/ChangeLog +10 -0
  3. package/HELP.md +55 -50
  4. package/README.md +1 -1
  5. package/bin/cloudcmd.mjs +22 -25
  6. package/bin/release.mjs +6 -7
  7. package/common/base64.js +2 -3
  8. package/common/callbackify.js +0 -1
  9. package/common/cloudfunc.js +12 -13
  10. package/common/datetime.js +1 -1
  11. package/common/entity.js +1 -2
  12. package/common/try-to-promise-all.js +0 -1
  13. package/common/util.js +3 -3
  14. package/dist/cloudcmd.common.js.map +1 -1
  15. package/dist/cloudcmd.css +1 -1
  16. package/dist/cloudcmd.js.map +1 -1
  17. package/dist/modules/operation.js.map +1 -1
  18. package/dist/modules/view.js.map +1 -1
  19. package/dist/sw.js +1 -1
  20. package/dist/sw.js.map +1 -1
  21. package/dist-dev/cloudcmd.common.js +13 -13
  22. package/dist-dev/cloudcmd.css +1 -1
  23. package/dist-dev/cloudcmd.js +3 -3
  24. package/dist-dev/modules/operation.js +1 -1
  25. package/dist-dev/modules/view.js +1 -1
  26. package/dist-dev/sw.js +1 -1
  27. package/package.json +7 -7
  28. package/server/auth.js +2 -2
  29. package/server/cloudcmd.js +4 -19
  30. package/server/columns.js +2 -2
  31. package/server/config.js +9 -6
  32. package/server/distribute/export.js +8 -7
  33. package/server/distribute/import.js +29 -34
  34. package/server/distribute/log.js +0 -1
  35. package/server/env.js +4 -5
  36. package/server/exit.js +0 -1
  37. package/server/markdown/index.js +0 -2
  38. package/server/markdown/worker.js +1 -0
  39. package/server/modulas.js +0 -1
  40. package/server/prefixer.js +0 -1
  41. package/server/repl.js +18 -17
  42. package/server/rest/index.js +8 -5
  43. package/server/rest/info.js +0 -1
  44. package/server/root.js +0 -1
  45. package/server/route.js +11 -15
  46. package/server/server.mjs +3 -9
  47. package/server/show-config.js +6 -2
  48. package/server/template.js +0 -1
  49. package/server/terminal.js +0 -1
  50. package/server/user-menu.js +4 -5
  51. package/server/validate.js +0 -1
  52. package/static/user-menu.js +52 -35
package/CONTRIBUTING.md CHANGED
@@ -4,12 +4,12 @@ Format of the commit message: **type(scope) subject**
4
4
 
5
5
  **Type**:
6
6
 
7
- - feature(scope) subject
8
- - fix(scope) subject
9
- - docs(scope) subject
10
- - refactor(scope) subject
11
- - test(scope) subject
12
- - chore(scope) subject
7
+ - feature: scope: subject
8
+ - fix: scope: subject
9
+ - docs: scope: subject
10
+ - refactor: scope: subject
11
+ - test: scope: subject
12
+ - chore: scope: subject
13
13
 
14
14
  **Scope**:
15
15
  Scope could be anything specifying place of the commit change.
package/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ 2023.07.09, v16.16.0
2
+
3
+ feature:
4
+ - c4f56c59 package: memfs v4.2.0
5
+ - 0e663e1d package: @putout/plugin-cloudcmd v3.1.1
6
+ - ff9265b7 package: c8 v8.0.0
7
+ - 22aa337a package: eslint-plugin-n v16.0.1
8
+ - 13350b55 package: eslint-plugin-putout v18.0.0
9
+ - ce196abf package: putout v30.1.1
10
+
1
11
  2023.05.17, v16.15.0
2
12
 
3
13
  feature:
package/HELP.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cloud Commander v16.15.0
1
+ # Cloud Commander v16.16.0
2
2
 
3
3
  ### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL]
4
4
 
@@ -374,50 +374,50 @@ Here's a description of all options:
374
374
 
375
375
  ```json
376
376
  {
377
- "name" : "", // set tab name in web browser
378
- "auth" : false, // enable http authentication
379
- "username" : "root", // username for authentication
380
- "password" : "toor", // password hash for authentication
381
- "algo" : "sha512WithRSAEncryption", // cryptographic algorithm
382
- "editor" : "edward", // default, could be "dword" or "edward"
383
- "packer" : "tar", // default, could be "tar" or "zip"
384
- "diff" : true, // when save - send patch, not whole file
385
- "zip" : true, // zip text before send / unzip before save
386
- "buffer" : true, // buffer for copying files
387
- "dirStorage" : true, // store directory listing
388
- "online" : false, // do not load js files from cdn
389
- "open" : true, // open web browser when server started
390
- "oneFilePanel" : false, // show one file panel
391
- "keysPanel" : true, // show classic panel with buttons of keys
392
- "port" : 8000, // http port
393
- "ip" : null, // ip or null(default)
394
- "root" : "/", // root directory
395
- "prefix" : "", // url prefix
396
- "prefixSocket" : "", // prefix for socket connection
397
- "confirmCopy" : true, // confirm copy
398
- "confirmMove" : true, // confirm move
399
- "showConfig" : false, // show config at startup
400
- "showFileName" : false, // do not show file name in view and edit
401
- "contact" : true, // enable contact
402
- "configDialog" : true, // enable config dialog
403
- "configAuth" : true, // enable auth change in config dialog
404
- "console" : true, // enable console
405
- "syncConsolePath" : false, // do not sync console path
406
- "terminal" : false, // disable terminal
407
- "terminalPath" : "", // path of a terminal
408
- "terminalCommand" : "", // set command to run in terminal
409
- "terminalAutoRestart" : true, // restart command on exit
410
- "vim" : false, // disable vim hot keys
411
- "columns" : "name-size-date-owner-mode", // set visible columns
412
- "export" : false, // enable export of config through a server
413
- "exportToken" : "root", // token used by export server
414
- "import" : false, // enable import of config
415
- "import-url" : "http://localhost:8000", // url of an export server
416
- "importToken" : "root", // token used to connect to export server
417
- "importListen" : false, // listen on config updates
418
- "dropbox" : false, // disable dropbox integration
419
- "dropboxToken" : "", // unset dropbox token
420
- "log" : true // logging
377
+ "name": "", // set tab name in web browser
378
+ "auth": false, // enable http authentication
379
+ "username": "root", // username for authentication
380
+ "password": "toor", // password hash for authentication
381
+ "algo": "sha512WithRSAEncryption", // cryptographic algorithm
382
+ "editor": "edward", // default, could be "dword" or "edward"
383
+ "packer": "tar", // default, could be "tar" or "zip"
384
+ "diff": true, // when save - send patch, not whole file
385
+ "zip": true, // zip text before send / unzip before save
386
+ "buffer": true, // buffer for copying files
387
+ "dirStorage": true, // store directory listing
388
+ "online": false, // do not load js files from cdn
389
+ "open": true, // open web browser when server started
390
+ "oneFilePanel": false, // show one file panel
391
+ "keysPanel": true, // show classic panel with buttons of keys
392
+ "port": 8000, // http port
393
+ "ip": null, // ip or null(default)
394
+ "root": "/", // root directory
395
+ "prefix": "", // url prefix
396
+ "prefixSocket": "", // prefix for socket connection
397
+ "confirmCopy": true, // confirm copy
398
+ "confirmMove": true, // confirm move
399
+ "showConfig": false, // show config at startup
400
+ "showFileName": false, // do not show file name in view and edit
401
+ "contact": true, // enable contact
402
+ "configDialog": true, // enable config dialog
403
+ "configAuth": true, // enable auth change in config dialog
404
+ "console": true, // enable console
405
+ "syncConsolePath": false, // do not sync console path
406
+ "terminal": false, // disable terminal
407
+ "terminalPath": "", // path of a terminal
408
+ "terminalCommand": "", // set command to run in terminal
409
+ "terminalAutoRestart": true, // restart command on exit
410
+ "vim": false, // disable vim hot keys
411
+ "columns": "name-size-date-owner-mode", // set visible columns
412
+ "export": false, // enable export of config through a server
413
+ "exportToken": "root", // token used by export server
414
+ "import": false, // enable import of config
415
+ "import-url": "http://localhost:8000", // url of an export server
416
+ "importToken": "root", // token used to connect to export server
417
+ "importListen": false, // listen on config updates
418
+ "dropbox": false, // disable dropbox integration
419
+ "dropboxToken": "", // unset dropbox token
420
+ "log": true // logging
421
421
  }
422
422
  ```
423
423
 
@@ -467,9 +467,7 @@ const RENAME_FILE = 'Rename file';
467
467
 
468
468
  export default {
469
469
  '__settings': {
470
- select: [
471
- RENAME_FILE,
472
- ],
470
+ select: [RENAME_FILE],
473
471
  run: false,
474
472
  },
475
473
  [`F2 - ${RENAME_FILE}`]: async ({DOM}) => {
@@ -499,7 +497,10 @@ export default {
499
497
  const path = `${dirPath}.cloudcmd.menu.js`;
500
498
  const {prefix} = CloudCmd;
501
499
 
502
- const data = await readDefaultMenu({prefix});
500
+ const data = await readDefaultMenu({
501
+ prefix,
502
+ });
503
+
503
504
  await createDefaultMenu({
504
505
  path,
505
506
  data,
@@ -743,6 +744,7 @@ const socket2 = new Server(server, {
743
744
  });
744
745
 
745
746
  const configManager1 = createConfigManager();
747
+
746
748
  configManager1('name', '1');
747
749
 
748
750
  const configManager2 = createConfigManager();
@@ -765,8 +767,10 @@ If you want to enable authorization, you can pass credentials to Cloud Commander
765
767
 
766
768
  ```js
767
769
  import criton from 'criton';
768
- const algo = 'sha512WithRSAEncryption'; // default
769
770
 
771
+ const algo = 'sha512WithRSAEncryption';
772
+
773
+ // default
770
774
  // you can generate a hash dynamically
771
775
  const password = criton('root', algo);
772
776
 
@@ -1089,6 +1093,7 @@ There are a lot of ways to be involved in `Cloud Commander` development:
1089
1093
 
1090
1094
  ## Version history
1091
1095
 
1096
+ - *2023.07.09*, **[v16.16.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.16.0)**
1092
1097
  - *2023.05.17*, **[v16.15.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.15.0)**
1093
1098
  - *2023.03.21*, **[v16.14.1](//github.com/coderaiser/cloudcmd/releases/tag/v16.14.1)**
1094
1099
  - *2023.03.08*, **[v16.14.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.14.0)**
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cloud Commander v16.15.0 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL]
1
+ # Cloud Commander v16.16.0 [![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/bin/cloudcmd.mjs CHANGED
@@ -5,13 +5,11 @@ import {promisify} from 'util';
5
5
  import tryToCatch from 'try-to-catch';
6
6
  import {createSimport} from 'simport';
7
7
  import parse from 'yargs-parser';
8
-
9
8
  import exit from '../server/exit.js';
10
9
  import {
11
10
  createConfig,
12
11
  configPath,
13
12
  } from '../server/config.js';
14
-
15
13
  import env from '../server/env.js';
16
14
  import prefixer from '../server/prefixer.js';
17
15
 
@@ -26,7 +24,7 @@ const simport = createSimport(import.meta.url);
26
24
  const choose = (a, b) => {
27
25
  if (a === undefined)
28
26
  return b;
29
-
27
+
30
28
  return a;
31
29
  };
32
30
 
@@ -39,7 +37,7 @@ const DIR_SERVER = '../server/';
39
37
  const maybeRoot = (a) => {
40
38
  if (a === '.')
41
39
  return process.cwd();
42
-
40
+
43
41
  return a;
44
42
  };
45
43
 
@@ -100,29 +98,29 @@ const yargsOptions = {
100
98
  'dropbox',
101
99
  ],
102
100
  default: {
103
- 'server' : true,
104
- 'name' : choose(env('name'), config('name')),
105
- 'auth' : choose(env.bool('auth'), config('auth')),
106
- 'port' : config('port'),
107
- 'online' : config('online'),
108
- 'open' : choose(env.bool('open'), config('open')),
109
- 'editor' : env('editor') || config('editor'),
110
- 'packer' : config('packer') || 'tar',
111
- 'zip' : config('zip'),
112
- 'username' : env('username') || config('username'),
113
- 'root' : choose(env('root'), config('root')),
114
- 'prefix' : choose(env('prefix'), config('prefix')),
115
- 'console' : choose(env.bool('console'), config('console')),
116
- 'contact' : choose(env.bool('contact'), config('contact')),
117
- 'terminal' : choose(env.bool('terminal'), config('terminal')),
118
- 'columns' : env('columns') || config('columns') || '',
119
- 'vim' : choose(env.bool('vim'), config('vim')),
120
- 'log' : config('log'),
101
+ 'server': true,
102
+ 'name': choose(env('name'), config('name')),
103
+ 'auth': choose(env.bool('auth'), config('auth')),
104
+ 'port': config('port'),
105
+ 'online': config('online'),
106
+ 'open': choose(env.bool('open'), config('open')),
107
+ 'editor': env('editor') || config('editor'),
108
+ 'packer': config('packer') || 'tar',
109
+ 'zip': config('zip'),
110
+ 'username': env('username') || config('username'),
111
+ 'root': choose(env('root'), config('root')),
112
+ 'prefix': choose(env('prefix'), config('prefix')),
113
+ 'console': choose(env.bool('console'), config('console')),
114
+ 'contact': choose(env.bool('contact'), config('contact')),
115
+ 'terminal': choose(env.bool('terminal'), config('terminal')),
116
+ 'columns': env('columns') || config('columns') || '',
117
+ 'vim': choose(env.bool('vim'), config('vim')),
118
+ 'log': config('log'),
121
119
 
122
120
  'import-url': env('import_url') || config('importUrl'),
123
121
  'import-listen': choose(env.bool('import_listen'), config('importListen')),
124
- 'import' : choose(env.bool('import'), config('import')),
125
- 'export' : choose(env.bool('export'), config('export')),
122
+ 'import': choose(env.bool('import'), config('import')),
123
+ 'export': choose(env.bool('export'), config('export')),
126
124
 
127
125
  'prefix-socket': config('prefixSocket'),
128
126
  'show-file-name': choose(env.bool('show_file_name'), config('showFileName')),
@@ -348,4 +346,3 @@ async function showUpdateInfo(version) {
348
346
 
349
347
  console.log('%s %s', latest, current);
350
348
  }
351
-
package/bin/release.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import {promisify} from 'util';
4
-
5
4
  import tryToCatch from 'try-to-catch';
6
5
  import {createSimport} from 'simport';
7
6
  import minor from 'minor';
@@ -20,8 +19,9 @@ async function main() {
20
19
  const history = '## Version history\n\n';
21
20
  const link = '//github.com/coderaiser/cloudcmd/releases/tag/';
22
21
  const template = '- *{{ date }}*, ' +
23
- '**[v{{ version }}]' +
24
- '(' + link + 'v{{ version }})**\n';
22
+ '**[v{{ version }}]' +
23
+ '(' + link +
24
+ 'v{{ version }})**\n';
25
25
 
26
26
  const {version} = Info;
27
27
 
@@ -34,8 +34,8 @@ async function main() {
34
34
  await replaceVersion('HELP.md', version, versionNew);
35
35
 
36
36
  const historyNew = history + rendy(template, {
37
- date : shortdate(),
38
- version : versionNew,
37
+ date: shortdate(),
38
+ version: versionNew,
39
39
  });
40
40
 
41
41
  await replaceVersion('HELP.md', history, historyNew);
@@ -68,7 +68,6 @@ async function cl() {
68
68
  function getVersionNew(last, match) {
69
69
  if (match)
70
70
  return minor(match, Info.version);
71
-
71
+
72
72
  return last.substr(3);
73
73
  }
74
-
package/common/base64.js CHANGED
@@ -3,7 +3,7 @@
3
3
  module.exports.btoa = (str) => {
4
4
  if (typeof btoa === 'function')
5
5
  return btoa(str);
6
-
6
+
7
7
  return Buffer
8
8
  .from(str)
9
9
  .toString('base64');
@@ -12,9 +12,8 @@ module.exports.btoa = (str) => {
12
12
  module.exports.atob = (str) => {
13
13
  if (typeof atob === 'function')
14
14
  return atob(str);
15
-
15
+
16
16
  return Buffer
17
17
  .from(str, 'base64')
18
18
  .toString('binary');
19
19
  };
20
-
@@ -9,4 +9,3 @@ module.exports = (promise) => (...a) => {
9
9
  .then(success(fn))
10
10
  .catch(fn);
11
11
  };
12
-
@@ -9,7 +9,6 @@ const {btoa} = require('./base64');
9
9
  const getHeaderField = currify(_getHeaderField);
10
10
 
11
11
  /* КОНСТАНТЫ (общие для клиента и сервера)*/
12
-
13
12
  /* название программы */
14
13
  const NAME = 'Cloud Commander';
15
14
  const FS = '/fs';
@@ -41,10 +40,7 @@ module.exports.formatMsg = (msg, name, status) => {
41
40
  module.exports.getTitle = (options) => {
42
41
  options = options || {};
43
42
 
44
- const {
45
- path = Path(),
46
- name,
47
- } = options;
43
+ const {path = Path(), name} = options;
48
44
 
49
45
  const array = [
50
46
  name || NAME,
@@ -71,7 +67,11 @@ function getPathLink(url, prefix, template) {
71
67
  .split('/')
72
68
  .slice(1, -1);
73
69
 
74
- const allNames = ['/', ...names];
70
+ const allNames = [
71
+ '/',
72
+ ...names,
73
+ ];
74
+
75
75
  const lines = [];
76
76
  const n = allNames.length;
77
77
 
@@ -165,7 +165,7 @@ module.exports.buildFromJSON = (params) => {
165
165
  Path(path);
166
166
 
167
167
  fileTable += `${header}<ul data-name="js-files" class="files">`;
168
-
168
+
169
169
  /* Если мы не в корне */
170
170
  if (path !== '/') {
171
171
  const dotDot = getDotDot(path);
@@ -199,7 +199,7 @@ module.exports.buildFromJSON = (params) => {
199
199
  .map((file) => {
200
200
  const name = encode(file.name);
201
201
  const link = prefix + FS + path + name;
202
-
202
+
203
203
  const {
204
204
  type,
205
205
  mode,
@@ -207,17 +207,17 @@ module.exports.buildFromJSON = (params) => {
207
207
  owner,
208
208
  size,
209
209
  } = file;
210
-
210
+
211
211
  const linkResult = rendy(templateLink, {
212
212
  link,
213
213
  title: name,
214
214
  name,
215
215
  attribute: getAttribute(file.type),
216
216
  });
217
-
217
+
218
218
  const dataName = getDataName(file.name);
219
219
  const attribute = `draggable="true" ${dataName}`;
220
-
220
+
221
221
  return rendy(templateFile, {
222
222
  tag: 'li',
223
223
  attribute,
@@ -249,7 +249,7 @@ function updateField(file) {
249
249
  function getAttribute(type) {
250
250
  if (type === 'directory')
251
251
  return '';
252
-
252
+
253
253
  return 'target="_blank" ';
254
254
  }
255
255
 
@@ -286,4 +286,3 @@ function getDotDot(path) {
286
286
 
287
287
  return dotDot;
288
288
  }
289
-
@@ -15,7 +15,7 @@ module.exports = (date) => {
15
15
  const addZero = (a) => {
16
16
  if (a > 9)
17
17
  return a;
18
-
18
+
19
19
  return `0${a}`;
20
20
  };
21
21
 
package/common/entity.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const Entities = {
4
- // '&nbsp;': ' ',
4
+ // '&nbsp;': ' ',
5
5
  '&lt;': '<',
6
6
  '&gt;': '>',
7
7
  '&quot;': '"',
@@ -30,4 +30,3 @@ module.exports.decode = (str) => {
30
30
 
31
31
  return str;
32
32
  };
33
-
@@ -11,4 +11,3 @@ module.exports = async (a) => {
11
11
  ...result,
12
12
  ];
13
13
  };
14
-
package/common/util.js CHANGED
@@ -16,15 +16,16 @@ module.exports.escapeRegExp = (str) => {
16
16
  */
17
17
  module.exports.getRegExp = (wildcard) => {
18
18
  const escaped = `^${wildcard // search from start of line
19
+
19
20
  .replace(/\./g, '\\.')
20
21
  .replace(/\*/g, '.*')
21
- .replace('?', '.?')}$`; // search to end of line
22
+ .replace('?', '.?')}$`;
22
23
 
24
+ // search to end of line
23
25
  return RegExp(escaped);
24
26
  };
25
27
 
26
28
  module.exports.exec = exec;
27
-
28
29
  /**
29
30
  * function gets file extension
30
31
  *
@@ -100,4 +101,3 @@ module.exports.time = (name) => {
100
101
  module.exports.timeEnd = (name) => {
101
102
  exec.ifExist(console, 'timeEnd', [name]);
102
103
  };
103
-