Skip to content

Commit

Permalink
refactor: add node: on Node.js imports
Browse files Browse the repository at this point in the history
  • Loading branch information
hsablonniere committed Oct 16, 2024
1 parent c722e8b commit e5196dd
Show file tree
Hide file tree
Showing 22 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion scripts/archive.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs-extra';
import path from 'path';
import path from 'node:path';
import * as cfg from './config.js';
import { getArchiveFilepath, getArchiveDirectory, getBinaryFilepath, getArchiveLatestFilepath, getBinaryLatestFilepath } from './paths.js';
import { generateChecksumFile, startTask, endTask, exec, cleanupDirectory, assertFileExists } from './utils.js';
Expand Down
2 changes: 1 addition & 1 deletion scripts/bundle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';
import { readFile } from 'fs/promises';
import * as cfg from './config.js';
import { startTask, writeStringToFile, applyTemplates, exec, endTask, generateChecksumFile, assertFileExists, cleanupDirectory } from './utils.js';
Expand Down
2 changes: 1 addition & 1 deletion scripts/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os from 'os';
import os from 'node:os';
import { getPackageJson } from '../src/load-package-json.cjs';
const pkg = getPackageJson();

Expand Down
2 changes: 1 addition & 1 deletion scripts/publish-cellar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';
import { cfg } from './config';
import { getCellarClient } from './cellar-client.js';
import { getArchiveFilepath, getShaFilepath, getArchiveLatestFilepath, getBundleFilepath, getBundleFilename } from './paths.js';
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish-dockerhub.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cfg } from './config';
import { cloneGitProject, applyTemplates, tagAndPush, commitAndPush, execSync } from './utils';
import childProcess from 'child_process';
import childProcess from 'node:child_process';

export async function publishDockerhub (version) {

Expand Down
4 changes: 2 additions & 2 deletions scripts/publish-nexus.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cfg } from './config';
import { promises as fs } from 'fs';
import path from 'path';
import { promises as fs } from 'node:fs';
import path from 'node:path';
import superagent from 'superagent';
import { getBundleFilepath } from './paths.js';

Expand Down
6 changes: 3 additions & 3 deletions scripts/utils.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import colors from 'colors/safe.js';
import _ from 'lodash';
import childProcess from 'child_process';
import childProcess from 'node:child_process';
import fs from 'fs-extra';
import glob from 'glob';
import { URL } from 'url';
import crypto from 'crypto';
import { URL } from 'node:url';
import crypto from 'node:crypto';
import { getShaFilepath } from './paths.js';
import del from 'del';

Expand Down
2 changes: 1 addition & 1 deletion src/commands/create.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';
import * as Application from '../models/application.js';
import * as AppConfig from '../models/app_configuration.js';
import { Logger } from '../logger.js';
Expand Down
2 changes: 1 addition & 1 deletion src/commands/curl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { spawn } from 'child_process';
import { spawn } from 'node:child_process';
import { loadOAuthConf, conf } from '../models/configuration.js';
import { addOauthHeader } from '@clevercloud/client/esm/oauth.js';
import { Logger } from '../logger.js';
Expand Down
2 changes: 1 addition & 1 deletion src/commands/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getBackups } from '@clevercloud/client/esm/api/v2/backups.js';
import { Logger } from '../logger.js';
import { formatTable as initFormatTable } from '../format-table.js';
import superagent from 'superagent';
import fs from 'fs';
import fs from 'node:fs';
import { findOwnerId } from '../models/addon.js';
import { resolveRealId, resolveAddonId } from '../models/ids-resolver.js';

Expand Down
2 changes: 1 addition & 1 deletion src/commands/diag.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os from 'os';
import os from 'node:os';

import { releaseInfo as getLinuxInfos } from 'linux-release-info';
import colors from 'colors/safe.js';
Expand Down
4 changes: 2 additions & 2 deletions src/commands/login.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import crypto from 'crypto';
import util from 'util';
import crypto from 'node:crypto';
import util from 'node:util';

import colors from 'colors/safe.js';
import open from 'open';
Expand Down
2 changes: 1 addition & 1 deletion src/commands/ssh.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { spawn } from 'child_process';
import { spawn } from 'node:child_process';

import * as Application from '../models/application.js';
import { conf } from '../models/configuration.js';
Expand Down
2 changes: 1 addition & 1 deletion src/logger.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'lodash';
import colors from 'colors/safe.js';
import { format } from 'util';
import { format } from 'node:util';

function getPrefix (severity) {
const prefix = `[${severity.toUpperCase()}] `;
Expand Down
4 changes: 2 additions & 2 deletions src/models/app_configuration.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { promises as fs } from 'fs';
import path from 'path';
import { promises as fs } from 'node:fs';
import path from 'node:path';

import _ from 'lodash';
import slugify from 'slugify';
Expand Down
4 changes: 2 additions & 2 deletions src/models/configuration.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { promises as fs } from 'fs';
import path from 'path';
import { promises as fs } from 'node:fs';
import path from 'node:path';

import commonEnv from 'common-env';
import mkdirp from 'mkdirp';
Expand Down
2 changes: 1 addition & 1 deletion src/models/deployments.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { promisify } from 'util';
import { promisify } from 'node:util';
import { Logger } from '../logger.js';
import { getDeployment, getAllDeployments } from '@clevercloud/client/esm/api/v2/application.js';
import { sendToApi } from './send-to-api.js';
Expand Down
4 changes: 2 additions & 2 deletions src/models/fs-utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { join } from 'path';
import { promises as fs } from 'fs';
import { join } from 'node:path';
import { promises as fs } from 'node:fs';

export function findPath (dir, name) {
const fullPath = join(dir, name);
Expand Down
4 changes: 2 additions & 2 deletions src/models/git.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';

import _ from 'lodash';
import git from 'isomorphic-git';
Expand Down
2 changes: 1 addition & 1 deletion src/models/interact.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import readline from 'readline';
import readline from 'node:readline';

function ask (question) {

Expand Down
2 changes: 1 addition & 1 deletion src/models/isomorphic-http-with-agent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import isomotphicHttp from 'isomorphic-git/http/node/index.js';
import https from 'https';
import https from 'node:https';

// We use our own HTTP plugin, so we can customize the agent used for requests and configure a long timeout (default is 5 seconds).

Expand Down
2 changes: 1 addition & 1 deletion src/models/variables.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _countBy from 'lodash/countBy.js';
import readline from 'readline';
import readline from 'node:readline';
import { ERROR_TYPES, parseRaw, toNameValueObject, validateName } from '@clevercloud/client/esm/utils/env-vars.js';

function readStdin () {
Expand Down

0 comments on commit e5196dd

Please sign in to comment.