diff --git a/.cloudcmd.menu.js b/.cloudcmd.menu.js index e2ba9ba7..95b6fa2b 100644 --- a/.cloudcmd.menu.js +++ b/.cloudcmd.menu.js @@ -28,10 +28,10 @@ module.exports = { await run(TerminalRun, 'npm run build:client:dev'); CloudCmd.refresh(); }, - 'P - Build Prod': async ({CloudCmd}) => { + 'P - Build Prod': ({CloudCmd}) => { const {TerminalRun} = CloudCmd; - run(TerminalRun, 'npm run build:client'), + run(TerminalRun, 'npm run build:client'); CloudCmd.refresh(); }, }; diff --git a/.dockerignore b/.dockerignore index 4f398708..1c9d9d9a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -19,6 +19,5 @@ cssnano.config.js bin/release.js client -legacy server_ diff --git a/.eslintrc.js b/.eslintrc.js index 85c5eacd..bc2b16c7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -26,7 +26,7 @@ module.exports = { 'plugin:node/recommended', ], }, { - files: ['{client,common}/**/*.js'], + files: ['{client,common,static}/**/*.js'], env: { browser: true, }, diff --git a/.madrun.js b/.madrun.js index 085a13d7..1aa362a3 100644 --- a/.madrun.js +++ b/.madrun.js @@ -3,29 +3,10 @@ const { run, parallel, - predefined, } = require('madrun'); const {version} = require('./package'); -const names = [ - 'bin/cloudcmd.js', - 'client', - 'common', - 'server', - 'test', - 'bin/release.js', - 'webpack.config.js', - 'cssnano.config.js', - '.webpack', - '.eslintrc.js', - '.madrun.js', - '{client,server,common}/**/*.spec.js', - '*.md', -]; - -const {putout} = predefined; - const env = 'THREAD_IT_COUNT=0'; const dockerName = 'coderaiser/cloudcmd'; @@ -35,9 +16,7 @@ module.exports = { 'build:start': () => run(['build:client', 'start']), 'build:start:dev': () => run(['build:client:dev', 'start:dev']), 'lint:all': () => run(['lint', 'lint:css', 'spell']), - 'lint': () => putout({ - names, - }), + 'lint': () => 'putout .', 'lint:css': () => 'stylelint css/*.css', 'spell': () => 'yaspeller .', 'fix:lint': () => run(['lint', 'lint:css'], '--fix'), diff --git a/.putout.json b/.putout.json index 4df23757..9fe0ba1f 100644 --- a/.putout.json +++ b/.putout.json @@ -1,7 +1,9 @@ { "ignore": [ "fixture*", - "dist*" + "dist*", + "app.json", + "fontello.json" ], "match": { "import.spec.js|console.js": { diff --git a/.travis.yml b/.travis.yml index 6d1e775f..ede6ca46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: node_js node_js: - 15 - 14 - - 12 cache: npm: false diff --git a/common/util.spec.js b/common/util.spec.js index c9227b46..4875c25c 100644 --- a/common/util.spec.js +++ b/common/util.spec.js @@ -89,7 +89,7 @@ test('util: findObjByNameInArr: array', (t) => { test('util: getRegExp', (t) => { const reg = getRegExp('hel?o.*'); - t.deepEqual(reg, RegExp('^hel.?o\\..*$'), 'should return regexp'); + t.deepEqual(reg, /^hel.?o\..*$/, 'should return regexp'); t.end(); }); @@ -103,7 +103,7 @@ test('util: getRegExp: dots', (t) => { test('util: getRegExp: no', (t) => { const reg = getRegExp(''); - t.deepEqual(reg, RegExp('^$'), 'should return regexp'); + t.deepEqual(reg, /^$/, 'should return regexp'); t.end(); }); diff --git a/server/rest/index.js b/server/rest/index.js index 0d6c0c7a..996f3120 100644 --- a/server/rest/index.js +++ b/server/rest/index.js @@ -87,7 +87,7 @@ function rest(config, request, response) { */ function sendData(params, config, callback) { const p = params; - const isMD = RegExp('^/markdown').test(p.name); + const isMD = /^\/markdown/.test(p.name); const rootDir = config('root'); if (isMD) diff --git a/static/user-menu.js b/static/user-menu.js index 7566c80f..2b4b2625 100644 --- a/static/user-menu.js +++ b/static/user-menu.js @@ -1,9 +1,9 @@ 'use strict'; -const RENAME_FILE= 'Rename file'; +const RENAME_FILE = 'Rename file'; module.exports = { - __settings: { + '__settings': { select: [ RENAME_FILE, ], @@ -27,7 +27,7 @@ module.exports = { CloudCmd, }); }, - 'D - Compare directories': async ({DOM}) => { + 'D - Compare directories': ({DOM}) => { const { CurrentInfo, getFilenames, diff --git a/static/user-menu.spec.js b/static/user-menu.spec.js index b493cc81..aa2aeda2 100644 --- a/static/user-menu.spec.js +++ b/static/user-menu.spec.js @@ -124,7 +124,7 @@ test('cloudcmd: static: user menu: compare directories', async (t) => { t.end(); }); -test('cloudcmd: static: user menu: compare directories: select names', async (t) => { +test('cloudcmd: static: user menu: compare directories: select names', (t) => { const {_selectNames} = defaultMenu; const selectFile = stub(); const file = {}; @@ -142,7 +142,7 @@ test('cloudcmd: static: user menu: compare directories: select names', async (t) t.end(); }); -test('cloudcmd: static: user menu: compare directories: select names: getCurrentByName', async (t) => { +test('cloudcmd: static: user menu: compare directories: select names: getCurrentByName', (t) => { const {_selectNames} = defaultMenu; const selectFile = stub(); const getCurrentByName = stub(); @@ -160,7 +160,7 @@ test('cloudcmd: static: user menu: compare directories: select names: getCurrent t.end(); }); -test('cloudcmd: static: user menu: compare directories: select names: compare', async (t) => { +test('cloudcmd: static: user menu: compare directories: select names: compare', (t) => { const {_compare} = defaultMenu; const a = [1, 2]; const b = [1, 3];