mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-17 16:38:18 +00:00
fix: cloudcmd: default -> named
This commit is contained in:
parent
b61818fe62
commit
a266c1452c
19 changed files with 20 additions and 21 deletions
|
|
@ -69,7 +69,7 @@ And create `index.js`:
|
|||
|
||||
```js
|
||||
import http from 'node:http';
|
||||
import cloudcmd from 'cloudcmd';
|
||||
import {cloudcmd} from 'cloudcmd';
|
||||
import {Server} from 'socket.io';
|
||||
import express from 'express';
|
||||
|
||||
|
|
|
|||
|
|
@ -232,7 +232,8 @@
|
|||
"#dom/rest": "./client/dom/rest.js",
|
||||
"#common/util": "./common/util.js",
|
||||
"#common/cloudfunc": "./common/cloudfunc.js",
|
||||
"#common/entity": "./common/entity.js"
|
||||
"#common/entity": "./common/entity.js",
|
||||
"#server/cloudcmd": "./server/cloudcmd.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
|
|
|
|||
|
|
@ -46,9 +46,7 @@ const clean = (a) => a.filter(notEmpty);
|
|||
const isUndefined = (a) => typeof a === 'undefined';
|
||||
const isFn = (a) => typeof a === 'function';
|
||||
|
||||
export default cloudcmd;
|
||||
|
||||
function cloudcmd(params) {
|
||||
export function cloudcmd(params) {
|
||||
const p = params || {};
|
||||
const options = p.config || {};
|
||||
const config = p.configManager || createConfig({
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import cloudcmd, {
|
|||
_getPrefix,
|
||||
_initAuth,
|
||||
_getIndexPath,
|
||||
} from './cloudcmd.js';
|
||||
} from '#server/cloudcmd';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import process from 'node:process';
|
|||
import {promisify} from 'node:util';
|
||||
import test from 'supertape';
|
||||
import {tryToCatch} from 'try-to-catch';
|
||||
import {createConfigManager} from '#server/cloudcmd';
|
||||
import {connect} from '../../test/before.js';
|
||||
import {createConfigManager} from '../cloudcmd.js';
|
||||
import {distributeImport} from './import.js';
|
||||
|
||||
const distribute = {
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import {promisify} from 'node:util';
|
|||
import {tryToCatch} from 'try-to-catch';
|
||||
import test from 'supertape';
|
||||
import serveOnce from 'serve-once';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
import markdown from './index.js';
|
||||
import cloudcmd from '../cloudcmd.js';
|
||||
|
||||
const config = {
|
||||
auth: false,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import fs from 'node:fs';
|
|||
import {tryToCatch} from 'try-to-catch';
|
||||
import {test, stub} from 'supertape';
|
||||
import serveOnce from 'serve-once';
|
||||
import cloudcmd from './cloudcmd.js';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
import {_getReadDir} from './route.js';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ import {Server} from 'socket.io';
|
|||
import tryRequire from 'tryrequire';
|
||||
import wraptile from 'wraptile';
|
||||
import compression from 'compression';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
import exit from './exit.js';
|
||||
import cloudcmd from './cloudcmd.js';
|
||||
|
||||
const bind = (f, self) => f.bind(self);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import {test, stub} from 'supertape';
|
||||
import {createConfigManager} from '#server/cloudcmd';
|
||||
import terminal from './terminal.js';
|
||||
import {createConfigManager} from './cloudcmd.js';
|
||||
|
||||
test('cloudcmd: terminal: disabled', (t) => {
|
||||
const config = createConfigManager();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import {test, stub} from 'supertape';
|
||||
import {tryCatch} from 'try-catch';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
import * as validate from './validate.js';
|
||||
import cloudcmd from './cloudcmd.js';
|
||||
|
||||
test('validate: root: bad', (t) => {
|
||||
const config = {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import express from 'express';
|
|||
import {Server} from 'socket.io';
|
||||
import writejson from 'writejson';
|
||||
import readjson from 'readjson';
|
||||
import cloudcmd from '../server/cloudcmd.js';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import serveOnce from 'serve-once';
|
||||
import test from 'supertape';
|
||||
import cloudcmd from '../../server/cloudcmd.js';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
|
||||
const configManager = cloudcmd.createConfigManager();
|
||||
const {request} = serveOnce(cloudcmd, {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import {mkdirSync} from 'node:fs';
|
|||
import serveOnce from 'serve-once';
|
||||
import test from 'supertape';
|
||||
import {rimraf} from 'rimraf';
|
||||
import cloudcmd from '../../server/cloudcmd.js';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import serveOnce from 'serve-once';
|
||||
import test from 'supertape';
|
||||
import cloudcmd from '../../server/cloudcmd.js';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
|
||||
const {request} = serveOnce(cloudcmd, {
|
||||
config: {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import {EventEmitter} from 'node:events';
|
|||
import wait from '@iocmd/wait';
|
||||
import {test, stub} from 'supertape';
|
||||
import serveOnce from 'serve-once';
|
||||
import cloudcmd from '../../server/cloudcmd.js';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
|
||||
test('cloudcmd: rest: move', async (t) => {
|
||||
const move = new EventEmitter();
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import tar from 'tar-stream';
|
|||
import gunzip from 'gunzip-maybe';
|
||||
import pullout from 'pullout';
|
||||
import serveOnce from 'serve-once';
|
||||
import cloudcmd from '../../server/cloudcmd.js';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import test from 'supertape';
|
|||
import {Volume} from 'memfs';
|
||||
import {ufs} from 'unionfs';
|
||||
import serveOnce from 'serve-once';
|
||||
import cloudcmd from '../../server/cloudcmd.js';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
|
||||
test('cloudcmd: rest: rename', async (t) => {
|
||||
const volume = {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import {dirname, join} from 'node:path';
|
|||
import {fileURLToPath} from 'node:url';
|
||||
import serveOnce from 'serve-once';
|
||||
import {test, stub} from 'supertape';
|
||||
import cloudcmd from '../../server/cloudcmd.js';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
import modulas from '../../server/modulas.js';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import {Buffer} from 'node:buffer';
|
|||
import serveOnce from 'serve-once';
|
||||
import test from 'supertape';
|
||||
import criton from 'criton';
|
||||
import cloudcmd from '../server/cloudcmd.js';
|
||||
import {cloudcmd} from '#server/cloudcmd';
|
||||
|
||||
const config = {
|
||||
auth: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue