mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature: server: bun support (oven-sh/bun#25674)
This commit is contained in:
parent
2ec57132ed
commit
ab20a462db
2 changed files with 5 additions and 5 deletions
|
|
@ -3,10 +3,11 @@ import {fileURLToPath} from 'node:url';
|
||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import fullstore from 'fullstore';
|
import fullstore from 'fullstore';
|
||||||
import nanomemoizeDefault from 'nano-memoize';
|
import * as nanomemoizeDefault from 'nano-memoize';
|
||||||
import readFilesSync from '@cloudcmd/read-files-sync';
|
import readFilesSync from '@cloudcmd/read-files-sync';
|
||||||
|
|
||||||
const {nanomemoize} = nanomemoizeDefault;
|
const nanomemoize = nanomemoizeDefault.default.nanomemoize || nanomemoizeDefault.default;
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = dirname(__filename);
|
const __dirname = dirname(__filename);
|
||||||
const isMap = (a) => /\.(map|js)$/.test(a);
|
const isMap = (a) => /\.(map|js)$/.test(a);
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,10 @@ import {fileURLToPath} from 'node:url';
|
||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import fullstore from 'fullstore';
|
import fullstore from 'fullstore';
|
||||||
import nanomemoizeDefault from 'nano-memoize';
|
import * as nanomemoizeDefault from 'nano-memoize';
|
||||||
import readFilesSync from '@cloudcmd/read-files-sync';
|
import readFilesSync from '@cloudcmd/read-files-sync';
|
||||||
|
|
||||||
|
const nanomemoize = nanomemoizeDefault.default.nanomemoize || nanomemoizeDefault.default;
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = dirname(__filename);
|
const __dirname = dirname(__filename);
|
||||||
const isMap = (a) => /\.(map|js)$/.test(a);
|
const isMap = (a) => /\.(map|js)$/.test(a);
|
||||||
|
|
@ -20,8 +21,6 @@ export const getThemes = ({isDev = _isDev()} = {}) => {
|
||||||
return readFilesSyncMemo(isDev);
|
return readFilesSyncMemo(isDev);
|
||||||
};
|
};
|
||||||
|
|
||||||
const {nanomemoize} = nanomemoizeDefault;
|
|
||||||
|
|
||||||
const readFilesSyncMemo = nanomemoize((isDev) => {
|
const readFilesSyncMemo = nanomemoize((isDev) => {
|
||||||
const dist = getDist(isDev);
|
const dist = getDist(isDev);
|
||||||
const themesDir = path.join(__dirname, '..', dist, 'themes');
|
const themesDir = path.join(__dirname, '..', dist, 'themes');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue