diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1744111e..eb4d7228 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -14,9 +14,9 @@ jobs: with: node-version: 16.x - name: Install Redrun - run: npm i redrun -g + run: bun i redrun -g --no-save - name: NPM Install - run: npm install + run: bun i --no-save - name: Lint run: redrun lint - name: Build diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index d543312b..c49d3c3b 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -14,14 +14,17 @@ jobs: - 20.x steps: - uses: actions/checkout@v3 + - uses: oven-sh/setup-bun@v1 + with: + bun-version: latest - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Install Redrun - run: npm i redrun -g + run: bun i redrun -g --no-save - name: Install - run: npm install + run: bun i --no-save - name: Lint run: redrun fix:lint - uses: actions/cache@v3 diff --git a/.madrun.mjs b/.madrun.mjs index 17191346..16e81941 100644 --- a/.madrun.mjs +++ b/.madrun.mjs @@ -1,3 +1,4 @@ +import process from 'node:process'; import { run, cutEnv, diff --git a/.webpack/css.js b/.webpack/css.js index 9eea5ce9..8ec50444 100644 --- a/.webpack/css.js +++ b/.webpack/css.js @@ -10,7 +10,7 @@ const { const ExtractTextPlugin = require('extract-text-webpack-plugin'); const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); -const {env} = process; +const {env} = require('process'); const isDev = env.NODE_ENV === 'development'; const extractCSS = (a) => new ExtractTextPlugin(`${a}.css`); diff --git a/.webpack/html.js b/.webpack/html.js index b684acb2..ef17b4f6 100644 --- a/.webpack/html.js +++ b/.webpack/html.js @@ -1,7 +1,7 @@ 'use strict'; const HtmlWebpackPlugin = require('html-webpack-plugin'); -const {env} = process; +const {env} = require('process'); const isDev = env.NODE_ENV === 'development'; diff --git a/.webpack/js.js b/.webpack/js.js index 068d3891..53be8dc1 100644 --- a/.webpack/js.js +++ b/.webpack/js.js @@ -11,11 +11,10 @@ const WebpackBar = require('webpackbar'); const ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin'); -const dir = './client'; -const dirModules = './client/modules'; +const {env} = require('process'); const modules = './modules'; - -const {env} = process; +const dirModules = './client/modules'; +const dir = './client'; const {NODE_ENV} = env; const isDev = NODE_ENV === 'development'; diff --git a/HELP.md b/HELP.md index 3c5870ae..4bbc0cb6 100644 --- a/HELP.md +++ b/HELP.md @@ -669,7 +669,7 @@ npm i cloudcmd express socket.io -S And create `index.js`: ```js -import http from 'http'; +import http from 'node:http'; import cloudcmd from 'cloudcmd'; import {Server} from 'socket.io'; import express from 'express'; @@ -722,7 +722,7 @@ server.listen(port); Here is example with two `Config Managers`: ```js -import http from 'http'; +import http from 'node:http'; import cloudcmd from 'cloudcmd'; import {Server} from 'socket.io'; import express from 'express'; diff --git a/README.md b/README.md index da19f148..120762d9 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ npm i cloudcmd express socket.io -S And create `index.js`: ```js -import http from 'http'; +import http from 'node:http'; import cloudcmd from 'cloudcmd'; import {Server} from 'socket.io'; import express from 'express'; diff --git a/bin/cloudcmd.mjs b/bin/cloudcmd.mjs index 9d55723b..3dd4efd7 100755 --- a/bin/cloudcmd.mjs +++ b/bin/cloudcmd.mjs @@ -1,10 +1,11 @@ #!/usr/bin/env node -import {createRequire} from 'module'; -import {promisify} from 'util'; +import {createRequire} from 'node:module'; +import {promisify} from 'node:util'; import tryToCatch from 'try-to-catch'; import {createSimport} from 'simport'; import parse from 'yargs-parser'; +import process from 'node:process'; import exit from '../server/exit.js'; import { createConfig, diff --git a/bin/release.mjs b/bin/release.mjs index ebc74ea4..e9ac53d9 100755 --- a/bin/release.mjs +++ b/bin/release.mjs @@ -1,12 +1,13 @@ #!/usr/bin/env node -import {promisify} from 'util'; +import {promisify} from 'node:util'; import tryToCatch from 'try-to-catch'; import {createSimport} from 'simport'; import minor from 'minor'; import _place from 'place'; import rendy from 'rendy'; import shortdate from 'shortdate'; +import process from 'node:process'; const simport = createSimport(import.meta.url); const place = promisify(_place); diff --git a/client/client.js b/client/client.js index 0e9938fb..bc8b778d 100644 --- a/client/client.js +++ b/client/client.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); /* global DOM */ const Emitify = require('emitify'); const inherits = require('inherits'); diff --git a/client/cloudcmd.js b/client/cloudcmd.js index 09dd202f..b3f4afd2 100644 --- a/client/cloudcmd.js +++ b/client/cloudcmd.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); require('../css/main.css'); require('../css/nojs.css'); require('../css/columns/name-size-date.css'); diff --git a/client/sw/sw.js b/client/sw/sw.js index 8431dc8a..58d27f7d 100644 --- a/client/sw/sw.js +++ b/client/sw/sw.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const codegen = require('codegen.macro'); const tryToCatch = require('try-to-catch'); const currify = require('currify'); diff --git a/server/cloudcmd.js b/server/cloudcmd.js index 365d5917..8991b969 100644 --- a/server/cloudcmd.js +++ b/server/cloudcmd.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const DIR = `${__dirname}/`; const DIR_COMMON = `${DIR}../common/`; const path = require('path'); diff --git a/server/cloudcmd.spec.js b/server/cloudcmd.spec.js index 19c04b6d..ca4d49cc 100644 --- a/server/cloudcmd.spec.js +++ b/server/cloudcmd.spec.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const path = require('path'); const {test, stub} = require('supertape'); diff --git a/server/columns.js b/server/columns.js index d684ee02..fd01e6b8 100644 --- a/server/columns.js +++ b/server/columns.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const path = require('path'); const fs = require('fs'); const readFilesSync = require('@cloudcmd/read-files-sync'); diff --git a/server/distribute/import.spec.js b/server/distribute/import.spec.js index 8467d147..c171bf07 100644 --- a/server/distribute/import.spec.js +++ b/server/distribute/import.spec.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const test = require('supertape'); const {promisify} = require('util'); const tryToCatch = require('try-to-catch'); diff --git a/server/env.js b/server/env.js index ef4089be..0d365ac8 100644 --- a/server/env.js +++ b/server/env.js @@ -2,7 +2,7 @@ const snake = require('just-snake-case'); -const {env} = process; +const {env} = require('process'); const up = (a) => a.toUpperCase(); module.exports = parse; diff --git a/server/env.spec.js b/server/env.spec.js index 7a9d925f..e29c937b 100644 --- a/server/env.spec.js +++ b/server/env.spec.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const test = require('supertape'); const env = require('./env'); diff --git a/server/exit.js b/server/exit.js index 1477b56b..7c02d35b 100644 --- a/server/exit.js +++ b/server/exit.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const getMessage = (a) => a?.message || a; module.exports = (...args) => { diff --git a/server/exit.spec.js b/server/exit.spec.js index f2ee85b9..5208c147 100644 --- a/server/exit.spec.js +++ b/server/exit.spec.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const {test, stub} = require('supertape'); const exit = require('./exit'); diff --git a/server/repl.js b/server/repl.js index d2b9ffb2..469a3d93 100644 --- a/server/repl.js +++ b/server/repl.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const net = require('net'); const repl = require('repl'); diff --git a/server/rest/index.js b/server/rest/index.js index 84089ac6..65ccd628 100644 --- a/server/rest/index.js +++ b/server/rest/index.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const DIR = '../'; const DIR_COMMON = `${DIR}../common/`; diff --git a/server/rest/info.js b/server/rest/info.js index 252e0dda..0a7e9f52 100644 --- a/server/rest/info.js +++ b/server/rest/info.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const format = require('format-io'); const {version} = require('../../package'); diff --git a/server/rest/info.spec.js b/server/rest/info.spec.js index 1924b4a2..358a5309 100644 --- a/server/rest/info.spec.js +++ b/server/rest/info.spec.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const {test, stub} = require('supertape'); const info = require('./info'); diff --git a/server/server.mjs b/server/server.mjs index 892042e9..09cabb69 100644 --- a/server/server.mjs +++ b/server/server.mjs @@ -1,6 +1,6 @@ import cloudcmd from './cloudcmd.js'; -import http from 'http'; -import {promisify} from 'util'; +import http from 'node:http'; +import {promisify} from 'node:util'; import currify from 'currify'; import squad from 'squad'; import tryToCatch from 'try-to-catch'; @@ -12,6 +12,7 @@ import opn from 'open'; import express from 'express'; import {Server} from 'socket.io'; import tryRequire from 'tryrequire'; +import process from 'node:process'; const bind = (f, self) => f.bind(self); diff --git a/test/before.js b/test/before.js index f8f4f36a..e3e1deff 100644 --- a/test/before.js +++ b/test/before.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const http = require('http'); const os = require('os'); diff --git a/test/server/columns.js b/test/server/columns.js index 2514f184..9e409ffb 100644 --- a/test/server/columns.js +++ b/test/server/columns.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const test = require('supertape'); const fs = require('fs'); const {reRequire} = require('mock-require'); diff --git a/test/server/env.js b/test/server/env.js index 140549cc..fa9c421d 100644 --- a/test/server/env.js +++ b/test/server/env.js @@ -1,5 +1,6 @@ 'use strict'; +const process = require('process'); const test = require('supertape'); const env = require('../../server/env');