From 7ef134f46f927273feb7c1e983da9d03b52ad96d Mon Sep 17 00:00:00 2001 From: coderiaser Date: Wed, 18 Feb 2026 19:21:47 +0200 Subject: [PATCH] feature: cloudcmd: rendy v5.0.0 --- bin/release.js | 2 +- client/client.js | 2 +- client/dom/load-remote.js | 2 +- client/modules/config/index.js | 2 +- client/modules/view/index.js | 2 +- common/cloudfunc.js | 3 +-- common/cloudfunc.spec.js | 33 +++++++++++++++++++++++++++++++++ package.json | 2 +- server/route.js | 2 +- 9 files changed, 41 insertions(+), 9 deletions(-) diff --git a/bin/release.js b/bin/release.js index 004b908e..a5eb39e2 100755 --- a/bin/release.js +++ b/bin/release.js @@ -6,7 +6,7 @@ import {tryToCatch} from 'try-to-catch'; import {createSimport} from 'simport'; import minor from 'minor'; import _place from 'place'; -import rendy from 'rendy'; +import {rendy} from 'rendy'; import shortdate from 'shortdate'; const simport = createSimport(import.meta.url); diff --git a/client/client.js b/client/client.js index f84547db..1c6d2008 100644 --- a/client/client.js +++ b/client/client.js @@ -1,7 +1,7 @@ import process from 'node:process'; import Emitify from 'emitify'; import inherits from 'inherits'; -import rendy from 'rendy'; +import {rendy} from 'rendy'; import load from 'load.js'; import {tryToCatch} from 'try-to-catch'; import {addSlashToEnd} from 'format-io'; diff --git a/client/dom/load-remote.js b/client/dom/load-remote.js index ff8fb189..43af0cf5 100644 --- a/client/dom/load-remote.js +++ b/client/dom/load-remote.js @@ -1,6 +1,6 @@ /* global CloudCmd */ import {callbackify} from 'node:util'; -import rendy from 'rendy'; +import {rendy} from 'rendy'; import itype from 'itype'; import * as load from 'load.js'; import {tryToCatch} from 'try-to-catch'; diff --git a/client/modules/config/index.js b/client/modules/config/index.js index e58c4f30..4f3965c3 100644 --- a/client/modules/config/index.js +++ b/client/modules/config/index.js @@ -1,6 +1,6 @@ /* global CloudCmd, DOM, io */ import '../../../css/config.css'; -import rendy from 'rendy'; +import {rendy} from 'rendy'; import currify from 'currify'; import wraptile from 'wraptile'; import squad from 'squad'; diff --git a/client/modules/view/index.js b/client/modules/view/index.js index 2fac8964..6626f1aa 100644 --- a/client/modules/view/index.js +++ b/client/modules/view/index.js @@ -1,5 +1,5 @@ import '#css/view.css'; -import rendy from 'rendy'; +import {rendy} from 'rendy'; import currify from 'currify'; import wraptile from 'wraptile'; import {tryToCatch} from 'try-to-catch'; diff --git a/common/cloudfunc.js b/common/cloudfunc.js index 3a9f61ba..a7df97df 100644 --- a/common/cloudfunc.js +++ b/common/cloudfunc.js @@ -1,4 +1,4 @@ -import rendy from 'rendy'; +import {rendy} from 'rendy'; import currify from 'currify'; import store from 'fullstore'; import {encode} from '#common/entity'; @@ -128,7 +128,6 @@ export const buildFromJSON = (params) => { const json = params.data; const path = encode(json.path); - const {files} = json; /* diff --git a/common/cloudfunc.spec.js b/common/cloudfunc.spec.js index 6f4ff9fe..4df48712 100644 --- a/common/cloudfunc.spec.js +++ b/common/cloudfunc.spec.js @@ -172,6 +172,39 @@ test('cloudfunc: buildFromJSON: showDotFiles: false', (t) => { t.end(); }); +test('cloudfunc: buildFromJSON: showDotFiles: false', (t) => { + const data = { + path: '/media/', + files: [{ + date: '30.08.2016', + mode: 'rwx rwx rwx', + name: '{{}}', + owner: 'root', + size: '7b', + type: 'file', + }], + }; + + const html = buildFromJSON({ + prefix: '', + template, + data, + showDotFiles: false, + }); + + const $ = cheerio.load(html); + const el = $('[data-name="js-file-JTdCJTdCJTdEJTdE"]'); + + const result = el + .find('[data-name="js-name"]') + .text(); + + const expected = '{{}}'; + + t.equal(result, expected); + t.end(); +}); + test('cloudfunc: _getDataName', (t) => { const result = _getDataName('s'); const expected = 'data-name="js-file-cw==" '; diff --git a/package.json b/package.json index c220f786..fe990df4 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "pullout": "^5.0.0", "putout": "^42.0.5", "redzip": "^4.0.0", - "rendy": "^4.1.3", + "rendy": "^5.0.0", "restafary": "^13.0.1", "restbox": "^4.0.0", "shortdate": "^2.0.0", diff --git a/server/route.js b/server/route.js index 736ad9b9..3b764b81 100644 --- a/server/route.js +++ b/server/route.js @@ -2,7 +2,7 @@ import {createRequire} from 'node:module'; import {extname} from 'node:path'; import * as _win32 from 'win32'; import ponse from 'ponse'; -import rendy from 'rendy'; +import {rendy} from 'rendy'; import format from 'format-io'; import currify from 'currify'; import wraptile from 'wraptile';