mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-17 16:38:18 +00:00
feature: common: cloudfunc -> #common/cloudfunc
This commit is contained in:
parent
1f174870ab
commit
8cad7514e7
18 changed files with 30 additions and 28 deletions
|
|
@ -17,7 +17,7 @@ import {
|
|||
apiURL,
|
||||
formatMsg,
|
||||
buildFromJSON,
|
||||
} from '../common/cloudfunc.mjs';
|
||||
} from '#common/cloudfunc';
|
||||
import {loadModule} from './load-module.mjs';
|
||||
|
||||
const noJS = (a) => a.replace(/.js$/, '');
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import * as Util from '#common/util';
|
|||
import '../css/main.css';
|
||||
import {registerSW, listenSW} from './sw/register.mjs';
|
||||
import {initSortPanel, sortPanel} from './sort.mjs';
|
||||
import * as CloudFunc from '../common/cloudfunc.mjs';
|
||||
import * as CloudFunc from '#common/cloudfunc';
|
||||
import DOM from './dom/index.mjs';
|
||||
import {createCloudCmd} from './client.mjs';
|
||||
import * as Listeners from './listeners/index.mjs';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* global CloudCmd */
|
||||
import createElement from '@cloudcmd/create-element';
|
||||
import {encode, decode} from '../../common/entity.js';
|
||||
import {getTitle, FS} from '../../common/cloudfunc.mjs';
|
||||
import {getTitle, FS} from '#common/cloudfunc';
|
||||
|
||||
let Title;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import philip from 'philip';
|
||||
import * as Dialog from '#dom/dialog';
|
||||
import * as Images from './images.mjs';
|
||||
import {FS} from '../../common/cloudfunc.mjs';
|
||||
import {FS} from '#common/cloudfunc';
|
||||
|
||||
export const uploadDirectory = (items) => {
|
||||
if (items.length)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
const {FS} = require('../../../common/cloudfunc.mjs');
|
||||
const {FS} = require('#common/cloudfunc');
|
||||
const _sendRequest = require('./send-request');
|
||||
|
||||
const imgPosition = {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import wraptile from 'wraptile';
|
|||
import * as load from '#dom/load';
|
||||
import {alert} from '#dom/dialog';
|
||||
import * as Images from './images.mjs';
|
||||
import {FS} from '../../common/cloudfunc.mjs';
|
||||
import {FS} from '#common/cloudfunc';
|
||||
import {getCurrentDirPath} from './current-file.mjs';
|
||||
|
||||
const loadFile = wraptile(_loadFile);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import clipboard from '@cloudcmd/clipboard';
|
|||
import * as Events from '#dom/events';
|
||||
import {uploadFiles} from '#dom/upload-files';
|
||||
import {getRange} from './get-range.mjs';
|
||||
import {FS} from '../../common/cloudfunc.mjs';
|
||||
import {FS} from '#common/cloudfunc';
|
||||
import {getIndex} from './get-index.mjs';
|
||||
|
||||
const NBSP_REG = RegExp(String.fromCharCode(160), 'g');
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import * as Files from '#dom/files';
|
|||
import '../../../css/config.css';
|
||||
import * as input from './input.mjs';
|
||||
import * as Images from '../../dom/images.mjs';
|
||||
import {getTitle} from '../../../common/cloudfunc.mjs';
|
||||
import {getTitle} from '#common/cloudfunc';
|
||||
|
||||
const {Dialog, setTitle} = DOM;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ const {promisify} = require('es6-promisify');
|
|||
const {tryToCatch} = require('try-to-catch');
|
||||
const createElement = require('@cloudcmd/create-element');
|
||||
const load = require('load.js');
|
||||
const {MAX_FILE_SIZE: maxSize} = require('../../common/cloudfunc.mjs');
|
||||
const {MAX_FILE_SIZE: maxSize} = require('#common/cloudfunc');
|
||||
|
||||
const {time, timeEnd} = require('#common/util');
|
||||
const getEditor = () => editor;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import wrap from 'wraptile';
|
|||
import createElement from '@cloudcmd/create-element';
|
||||
import {getIdBySrc} from '#dom/load';
|
||||
import * as RESTful from '#dom/rest';
|
||||
import {FS} from '../../../common/cloudfunc.mjs';
|
||||
import {FS} from '#common/cloudfunc';
|
||||
|
||||
const {config, Key} = CloudCmd;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* global CloudCmd, DOM */
|
||||
import '#css/view.css';
|
||||
import rendy from 'rendy';
|
||||
import currify from 'currify';
|
||||
import wraptile from 'wraptile';
|
||||
|
|
@ -9,8 +9,7 @@ import _createElement from '@cloudcmd/create-element';
|
|||
import {time} from '#common/util';
|
||||
import * as Files from '#dom/files';
|
||||
import * as Events from '#dom/events';
|
||||
import '../../../css/view.css';
|
||||
import {FS} from '../../../common/cloudfunc.mjs';
|
||||
import {FS} from '#common/cloudfunc';
|
||||
import {
|
||||
isImage,
|
||||
isAudio,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
getPathLink,
|
||||
buildFromJSON,
|
||||
_getDataName,
|
||||
} from './cloudfunc.mjs';
|
||||
} from '#common/cloudfunc';
|
||||
|
||||
const templatePath = new URL('../tmpl/fs', import.meta.url).pathname;
|
||||
|
||||
|
|
|
|||
|
|
@ -220,6 +220,7 @@
|
|||
"webpackbar": "^7.0.0"
|
||||
},
|
||||
"imports": {
|
||||
"#css/": "./css/",
|
||||
"#dom/events": "./client/dom/events/index.mjs",
|
||||
"#dom/load": "./client/dom/load.mjs",
|
||||
"#dom/dialog": "./client/dom/dialog.mjs",
|
||||
|
|
@ -227,7 +228,8 @@
|
|||
"#dom/upload-files": "./client/dom/upload-files.mjs",
|
||||
"#dom/storage": "./client/dom/storage.mjs",
|
||||
"#dom/rest": "./client/dom/rest.mjs",
|
||||
"#common/util": "./common/util.mjs"
|
||||
"#common/util": "./common/util.mjs",
|
||||
"#common/cloudfunc": "./common/cloudfunc.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import dword from 'dword';
|
|||
import deepword from 'deepword';
|
||||
import nomine from 'nomine';
|
||||
import fileop from '@cloudcmd/fileop';
|
||||
import * as cloudfunc from '../common/cloudfunc.mjs';
|
||||
import * as cloudfunc from '#common/cloudfunc';
|
||||
import authentication from './auth.js';
|
||||
import {createConfig, configPath} from './config.mjs';
|
||||
import modulas from './modulas.mjs';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import {createRequire} from 'node:module';
|
||||
import {test, stub} from 'supertape';
|
||||
import {createConfig, _cryptoPass} from './config.mjs';
|
||||
import {apiURL} from '../common/cloudfunc.mjs';
|
||||
import {apiURL} from '#common/cloudfunc';
|
||||
import {connect} from '../test/before.mjs';
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import ponse from 'ponse';
|
|||
import copymitter from 'copymitter';
|
||||
import _moveFiles from '@cloudcmd/move-files';
|
||||
import root from '../root.js';
|
||||
import * as CloudFunc from '../../common/cloudfunc.mjs';
|
||||
import * as CloudFunc from '#common/cloudfunc';
|
||||
import markdown from '../markdown/index.js';
|
||||
import info from './info.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import pipe from 'pipe-io';
|
|||
import {contentType} from 'mime-types';
|
||||
import root from './root.js';
|
||||
import prefixer from './prefixer.js';
|
||||
import * as CloudFunc from '../common/cloudfunc.mjs';
|
||||
import * as CloudFunc from '#common/cloudfunc';
|
||||
import Template from './template.js';
|
||||
import {getColumns} from './columns.mjs';
|
||||
import {getThemes} from './theme.mjs';
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const {test} = require('supertape');
|
|||
const readFilesSync = require('@cloudcmd/read-files-sync');
|
||||
|
||||
const {time, timeEnd} = require(`../../common/util.mjs`);
|
||||
const CloudFunc = require('../../common/cloudfunc.mjs');
|
||||
const CloudFunc = require('#common/cloudfunc');
|
||||
|
||||
const DIR = `${__dirname}/../../`;
|
||||
|
||||
|
|
@ -43,7 +43,8 @@ const data = {
|
|||
}],
|
||||
};
|
||||
|
||||
let Expect = '<div data-name="js-path" class="reduce-text" title="/etc/X11/">' +
|
||||
let Expect =
|
||||
'<div data-name="js-path" class="reduce-text" title="/etc/X11/">' +
|
||||
'<span data-name="js-copy-path" class="path-icon icon-copy-to-clipboard"' +
|
||||
' title="copy path (Ctrl+P)">' +
|
||||
'</span>' +
|
||||
|
|
@ -73,13 +74,13 @@ test('cloudfunc: render', (t) => {
|
|||
const isNotOk = Expect
|
||||
.split('')
|
||||
.some((item, number) => {
|
||||
const ret = result[number] !== item;
|
||||
|
||||
if (ret)
|
||||
i = number;
|
||||
|
||||
return ret;
|
||||
});
|
||||
const ret = result[number] !== item;
|
||||
|
||||
if (ret)
|
||||
i = number;
|
||||
|
||||
return ret;
|
||||
});
|
||||
|
||||
timeEnd('CloudFunc.buildFromJSON');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue