Skip to content

Commit

Permalink
update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
erikian committed Feb 23, 2025
1 parent 150dfd1 commit 20747f8
Show file tree
Hide file tree
Showing 30 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion src/arch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execSync } from 'child_process';
import { execSync } from 'node:child_process';

/**
* Runs the `uname` command and returns the trimmed output.
Expand Down
6 changes: 3 additions & 3 deletions src/cache.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import crypto from 'crypto';
import crypto from 'node:crypto';
import debug from 'debug';
import fs from 'fs-extra';
import path from 'path';
import zlib from 'zlib';
import path from 'node:path';
import zlib from 'node:zlib';

const d = debug('electron-rebuild');

Expand Down
10 changes: 5 additions & 5 deletions src/clang-fetcher.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as cp from 'child_process';
import cp from 'node:child_process';
import debug from 'debug';
import * as fs from 'fs-extra';
import * as path from 'path';
import * as tar from 'tar';
import * as zlib from 'zlib';
import fs from 'fs-extra';
import path from 'node:path';
import tar from 'tar';
import zlib from 'node:zlib';
import { ELECTRON_GYP_DIR } from './constants';
import { fetch } from './fetcher';
import { downloadLinuxSysroot } from './sysroot-fetcher';
Expand Down
4 changes: 2 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node

import chalk from 'chalk';
import * as fs from 'fs-extra';
import * as path from 'path';
import fs from 'fs-extra';
import path from 'node:path';
import ora = require('ora');
import yargs from 'yargs/yargs';

Expand Down
4 changes: 2 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as os from 'os';
import * as path from 'path';
import os from 'node:os';
import path from 'node:path';

export const ELECTRON_GYP_DIR = path.resolve(os.homedir(), '.electron-gyp');
4 changes: 2 additions & 2 deletions src/electron-locator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as fs from 'fs-extra';
import * as path from 'path';
import fs from 'fs-extra';
import path from 'node:path';
import { searchForModule } from './search-module';

const electronModuleNames = ['electron', 'electron-prebuilt-compile'];
Expand Down
4 changes: 2 additions & 2 deletions src/module-rebuilder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import debug from 'debug';
import * as fs from 'fs-extra';
import * as path from 'path';
import fs from 'fs-extra';
import path from 'node:path';

import { cacheModuleState } from './cache';
import { NodeGyp } from './module-type/node-gyp/node-gyp';
Expand Down
2 changes: 1 addition & 1 deletion src/module-type/index.ts
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 { NodeAPI } from '../node-api';
import { readPackageJson } from '../read-package-json';
Expand Down
4 changes: 2 additions & 2 deletions src/module-type/node-gyp/node-gyp.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import debug from 'debug';
import detectLibc from 'detect-libc';
import path from 'path';
import path from 'node:path';
import semver from 'semver';

import { ELECTRON_GYP_DIR } from '../../constants';
import { getClangEnvironmentVars } from '../../clang-fetcher';
import { NativeModule } from '..';
import { fork } from 'child_process';
import { fork } from 'node:child_process';

const d = debug('electron-rebuild');

Expand Down
2 changes: 1 addition & 1 deletion src/module-type/prebuild-install.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import debug from 'debug';
import fs from 'fs-extra';
import path from 'path';
import path from 'node:path';
import { spawn } from '@malept/cross-spawn-promise';

import { locateBinary, NativeModule } from '.';
Expand Down
2 changes: 1 addition & 1 deletion src/module-type/prebuildify.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import debug from 'debug';
import fs from 'fs-extra';
import path from 'path';
import path from 'node:path';

import { ConfigVariables, getNodeArch } from '../arch';
import { NativeModule } from '.';
Expand Down
2 changes: 1 addition & 1 deletion src/module-walker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import debug from 'debug';
import fs from 'fs-extra';
import path from 'path';
import path from 'node:path';

import { readPackageJson } from './read-package-json';
import { searchForModule, searchForNodeModules } from './search-module';
Expand Down
4 changes: 2 additions & 2 deletions src/read-package-json.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as fs from 'fs-extra';
import * as path from 'path';
import fs from 'fs-extra';
import path from 'node:path';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function readPackageJson(dir: string, safe = false): Promise<any> {
Expand Down
10 changes: 5 additions & 5 deletions src/rebuild.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import debug from 'debug';
import { EventEmitter } from 'events';
import * as fs from 'fs-extra';
import * as nodeAbi from 'node-abi';
import * as os from 'os';
import * as path from 'path';
import { EventEmitter } from 'node:events';
import fs from 'fs-extra';
import nodeAbi from 'node-abi';
import os from 'node:os';
import path from 'node:path';

import { generateCacheKey, lookupModuleState } from './cache';
import { BuildType, IRebuilder, RebuildMode } from './types';
Expand Down
4 changes: 2 additions & 2 deletions src/search-module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as fs from 'fs-extra';
import * as path from 'path';
import fs from 'fs-extra';
import path from 'node:path';

async function shouldContinueSearch(traversedPath: string, rootPath?: string, stopAtPackageJSON?: boolean): Promise<boolean> {
if (rootPath) {
Expand Down
6 changes: 3 additions & 3 deletions src/sysroot-fetcher.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { spawn } from '@malept/cross-spawn-promise';
import * as crypto from 'crypto';
import crypto from 'node:crypto';
import debug from 'debug';
import * as fs from 'fs-extra';
import * as path from 'path';
import fs from 'fs-extra';
import path from 'node:path';

import { ELECTRON_GYP_DIR } from './constants';
import { fetch } from './fetcher';
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EventEmitter } from 'events';
import { EventEmitter } from 'node:events';

export enum BuildType {
Debug = 'Debug',
Expand Down
4 changes: 2 additions & 2 deletions test/electron-locator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import * as fs from 'fs-extra';
import * as path from 'path';
import fs from 'fs-extra';
import path from 'node:path';

import { locateElectronModule } from '../lib/electron-locator';

Expand Down
4 changes: 2 additions & 2 deletions test/helpers/electron-version.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as fs from 'fs-extra';
import * as path from 'path';
import fs from 'fs-extra';
import path from 'node:path';

function electronVersionPath() {
// eslint-disable-next-line @typescript-eslint/no-var-requires
Expand Down
6 changes: 3 additions & 3 deletions test/helpers/module-setup.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import debug from 'debug';
import crypto from 'crypto';
import crypto from 'node:crypto';
import fs from 'fs-extra';
import os from 'os';
import path from 'path';
import os from 'node:os';
import path from 'node:path';
import { spawn } from '@malept/cross-spawn-promise';

const d = debug('electron-rebuild');
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/rebuild.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import * as fs from 'fs-extra';
import * as path from 'path';
import fs from 'fs-extra';
import path from 'node:path';

type ExpectRebuildOptions = {
buildType?: string;
Expand Down
2 changes: 1 addition & 1 deletion test/module-type-node-gyp.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EventEmitter } from 'events';
import { EventEmitter } from 'node:events';
import chai, { expect } from 'chai';
import chaiAsPromised from 'chai-as-promised';

Expand Down
4 changes: 2 additions & 2 deletions test/module-type-node-pre-gyp.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import chai, { expect } from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { EventEmitter } from 'events';
import path from 'path';
import { EventEmitter } from 'node:events';
import path from 'node:path';

import { cleanupTestModule, resetTestModule, TIMEOUT_IN_MILLISECONDS, TEST_MODULE_PATH as testModulePath } from './helpers/module-setup';
import { NodePreGyp } from '../lib/module-type/node-pre-gyp';
Expand Down
4 changes: 2 additions & 2 deletions test/module-type-prebuild-install.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import chai, { expect } from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { EventEmitter } from 'events';
import path from 'path';
import { EventEmitter } from 'node:events';
import path from 'node:path';

import { cleanupTestModule, resetTestModule, TIMEOUT_IN_MILLISECONDS, TEST_MODULE_PATH as testModulePath } from './helpers/module-setup';
import { PrebuildInstall } from '../lib/module-type/prebuild-install';
Expand Down
4 changes: 2 additions & 2 deletions test/module-type-prebuildify.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EventEmitter } from 'events';
import { EventEmitter } from 'node:events';
import { expect } from 'chai';
import path from 'path';
import path from 'node:path';

import {
determineNativePrebuildArch,
Expand Down
2 changes: 1 addition & 1 deletion test/read-package-json.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as path from 'path';
import path from 'node:path';
import { expect } from 'chai';

import { readPackageJson } from '../lib/read-package-json';
Expand Down
4 changes: 2 additions & 2 deletions test/rebuild-napibuildversion.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as fs from 'fs-extra';
import * as path from 'path';
import fs from 'fs-extra';
import path from 'node:path';

import { expect } from 'chai';
import { rebuild } from '../lib/rebuild';
Expand Down
2 changes: 1 addition & 1 deletion test/rebuild-yarnworkspace.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as path from 'path';
import path from 'node:path';

import { expectNativeModuleToBeRebuilt, expectNativeModuleToNotBeRebuilt } from './helpers/rebuild';
import { getExactElectronVersionSync } from './helpers/electron-version';
Expand Down
6 changes: 3 additions & 3 deletions test/rebuild.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EventEmitter } from 'events';
import { EventEmitter } from 'node:events';
import { expect } from 'chai';
import * as fs from 'fs-extra';
import * as path from 'path';
import fs from 'fs-extra';
import path from 'node:path';

import { cleanupTestModule, MINUTES_IN_MILLISECONDS, TEST_MODULE_PATH as testModulePath, resetMSVSVersion, resetTestModule, TIMEOUT_IN_MILLISECONDS } from './helpers/module-setup';
import { expectNativeModuleToBeRebuilt, expectNativeModuleToNotBeRebuilt } from './helpers/rebuild';
Expand Down
6 changes: 3 additions & 3 deletions test/search-module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai';
import * as fs from 'fs-extra';
import * as os from 'os';
import * as path from 'path';
import fs from 'fs-extra';
import os from 'node:os';
import path from 'node:path';

import { getProjectRootPath } from '../lib/search-module';

Expand Down

0 comments on commit 20747f8

Please sign in to comment.