Skip to content

Commit

Permalink
refactor(all): use node: prefixes (#3784)
Browse files Browse the repository at this point in the history
* refactor(all): use `node:` prefixes

* proxyquire
  • Loading branch information
erickzhao authored Dec 13, 2024
1 parent f9c33f8 commit eed415b
Show file tree
Hide file tree
Showing 102 changed files with 131 additions and 131 deletions.
2 changes: 1 addition & 1 deletion packages/api/cli/src/electron-forge-import.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { api } from '@electron-forge/core';
import program from 'commander';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/cli/src/electron-forge-init.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { api, InitOptions } from '@electron-forge/core';
import program from 'commander';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/cli/src/electron-forge-make.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { api, MakeOptions } from '@electron-forge/core';
import { initializeProxy } from '@electron/get';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/cli/src/electron-forge-package.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { api, PackageOptions } from '@electron-forge/core';
import { initializeProxy } from '@electron/get';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/cli/src/electron-forge-publish.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { api, PublishOptions } from '@electron-forge/core';
import { initializeProxy } from '@electron/get';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/cli/src/electron-forge-start.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { api, StartOptions } from '@electron-forge/core';
import { ElectronProcess } from '@electron-forge/shared-types';
Expand Down
6 changes: 3 additions & 3 deletions packages/api/cli/src/util/check-system.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { exec } from 'child_process';
import os from 'os';
import path from 'path';
import { exec } from 'node:child_process';
import os from 'node:os';
import path from 'node:path';

import { utils as forgeUtils } from '@electron-forge/core';
import { ForgeListrTask } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/cli/src/util/working-dir.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import fs from 'fs-extra';

Expand Down
2 changes: 1 addition & 1 deletion packages/api/cli/test/cli_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { spawn } from '@malept/cross-spawn-promise';
import chai, { expect } from 'chai';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/import.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { safeYarnOrNpm, updateElectronDependency } from '@electron-forge/core-utils';
import { ForgeListrOptions, ForgeListrTaskFn } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/init-scripts/init-git.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { exec } from 'child_process';
import { exec } from 'node:child_process';

import debug from 'debug';

Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/init-scripts/init-link.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { safeYarnOrNpm, yarnOrNpmSpawn } from '@electron-forge/core-utils';
import { ForgeListrTask } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/init-scripts/init-npm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { safeYarnOrNpm } from '@electron-forge/core-utils';
import { ForgeListrTask } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/init.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { safeYarnOrNpm } from '@electron-forge/core-utils';
import { ForgeTemplate } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/make.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { getElectronVersion } from '@electron-forge/core-utils';
import { MakerBase } from '@electron-forge/maker-base';
Expand Down
4 changes: 2 additions & 2 deletions packages/api/core/src/api/package.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import { promisify } from 'util';
import path from 'node:path';
import { promisify } from 'node:util';

import { getElectronVersion, listrCompatibleRebuildHook } from '@electron-forge/core-utils';
import { ForgeArch, ForgeListrTask, ForgeListrTaskDefinition, ForgeListrTaskFn, ForgePlatform, ResolvedForgeConfig } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/publish.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { PublisherBase } from '@electron-forge/publisher-base';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/start.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { spawn, SpawnOptions } from 'child_process';
import { spawn, SpawnOptions } from 'node:child_process';

import { getElectronVersion, listrCompatibleRebuildHook } from '@electron-forge/core-utils';
import {
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion packages/api/core/src/util/electron-executable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { getElectronModulePath } from '@electron-forge/core-utils';
import logSymbols from 'log-symbols';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/util/forge-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { ForgeConfig, ResolvedForgeConfig } from '@electron-forge/shared-types';
import fs from 'fs-extra';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/util/import-search.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import debug from 'debug';

Expand Down
4 changes: 2 additions & 2 deletions packages/api/core/src/util/linux-installer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { spawnSync } from 'child_process';
import { promisify } from 'util';
import { spawnSync } from 'node:child_process';
import { promisify } from 'node:util';

import sudoPrompt from 'sudo-prompt';

Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/util/out-dir.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { ResolvedForgeConfig } from '@electron-forge/shared-types';

Expand Down
4 changes: 2 additions & 2 deletions packages/api/core/src/util/publish-state.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import crypto from 'crypto';
import path from 'path';
import crypto from 'node:crypto';
import path from 'node:path';

import { ForgeMakeResult } from '@electron-forge/shared-types';
import fs from 'fs-extra';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/util/read-package-json.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { ResolvedForgeConfig } from '@electron-forge/shared-types';
import fs from 'fs-extra';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/util/resolve-dir.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { getElectronVersion } from '@electron-forge/core-utils';
import debug from 'debug';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/util/upgrade-forge-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { ForgeConfig, ForgePlatform, IForgeResolvableMaker, IForgeResolvablePublisher } from '@electron-forge/shared-types';

Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/test/fast/electron-executable_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import chai, { expect } from 'chai';
import { createSandbox } from 'sinon';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/test/fast/forge-config_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { ResolvedForgeConfig } from '@electron-forge/shared-types';
import { expect } from 'chai';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/test/fast/make_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as path from 'path';
import * as path from 'node:path';

import { ForgeMakeResult } from '@electron-forge/shared-types';
import { expect } from 'chai';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/test/fast/out-dir_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { ResolvedForgeConfig } from '@electron-forge/shared-types';
import { expect } from 'chai';
Expand Down
4 changes: 2 additions & 2 deletions packages/api/core/test/fast/publish_spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os from 'os';
import path from 'path';
import os from 'node:os';
import path from 'node:path';

import { ForgeConfigPublisher, IForgePublisher } from '@electron-forge/shared-types';
import { expect } from 'chai';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/test/fast/read-package-json_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { ResolvedForgeConfig } from '@electron-forge/shared-types';
import { expect } from 'chai';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/test/fast/resolve-dir_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { expect } from 'chai';

Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/test/fast/start_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('start', () => {
'../util/read-package-json': {
readMutatedPackageJson: () => Promise.resolve(packageJSON),
},
child_process: {
'node:child_process': {
spawn: spawnStub,
},
}).default;
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/test/fast/upgrade-forge-config_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert';
import assert from 'node:assert';

import { ForgeConfig, IForgeResolvableMaker, IForgeResolvablePublisher } from '@electron-forge/shared-types';
import { expect } from 'chai';
Expand Down
6 changes: 3 additions & 3 deletions packages/api/core/test/slow/api_spec_slow.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'assert';
import { execSync } from 'child_process';
import path from 'path';
import assert from 'node:assert';
import { execSync } from 'node:child_process';
import path from 'node:path';

import { yarnOrNpmSpawn } from '@electron-forge/core-utils';
import { createDefaultCertificate } from '@electron-forge/maker-appx';
Expand Down
6 changes: 3 additions & 3 deletions packages/api/core/test/slow/init_git_spec_slow.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { execSync } from 'child_process';
import os from 'os';
import path from 'path';
import { execSync } from 'node:child_process';
import os from 'node:os';
import path from 'node:path';

import { expect } from 'chai';
import fs from 'fs-extra';
Expand Down
4 changes: 2 additions & 2 deletions packages/api/core/test/slow/install-dependencies_spec_slow.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os from 'os';
import path from 'path';
import os from 'node:os';
import path from 'node:path';

import { expect } from 'chai';
import fs from 'fs-extra';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/appx/src/MakerAppX.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';
Expand Down
4 changes: 2 additions & 2 deletions packages/maker/appx/test/MakerAppX_spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { tmpdir } from 'os';
import { join } from 'path';
import { tmpdir } from 'node:os';
import { join } from 'node:path';

import { expect } from 'chai';
import fs from 'fs-extra';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/base/src/Maker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { ForgeArch, ForgePlatform, IForgeMaker, ResolvedForgeConfig } from '@electron-forge/shared-types';
import fs from 'fs-extra';
Expand Down
4 changes: 2 additions & 2 deletions packages/maker/base/test/ensure-output_spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os from 'os';
import path from 'path';
import os from 'node:os';
import path from 'node:path';

import { expect } from 'chai';
import fs from 'fs-extra';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/deb/src/MakerDeb.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch, ForgePlatform } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/deb/test/MakerDeb_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/dmg/src/MakerDMG.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/dmg/test/MakerDMG_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { expect } from 'chai';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/flatpak/src/MakerFlatpak.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch, ForgePlatform } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/flatpak/test/MakerFlatpak_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/pkg/src/MakerPKG.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/pkg/test/MakerPKG_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { expect } from 'chai';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/rpm/src/MakerRpm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch, ForgePlatform } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/rpm/test/MakerRpm_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/snap/src/MakerSnap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/snap/test/MakerSnap_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { expect } from 'chai';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/squirrel/src/MakerSquirrel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/wix/src/MakerWix.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';
Expand Down
4 changes: 2 additions & 2 deletions packages/maker/zip/src/MakerZIP.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import { promisify } from 'util';
import path from 'node:path';
import { promisify } from 'node:util';

import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';
Expand Down
4 changes: 2 additions & 2 deletions packages/maker/zip/test/MakerZip_spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os from 'os';
import path from 'path';
import os from 'node:os';
import path from 'node:path';

import { expect } from 'chai';
import fs from 'fs-extra';
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/fuses/src/FusesPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { namedHookWithTaskFn, PluginBase } from '@electron-forge/plugin-base';
import { ForgeMultiHookMap, ForgePlatform } from '@electron-forge/shared-types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path';
import path from 'node:path';

import { ForgePlatform } from '@electron-forge/shared-types';

Expand Down
Loading

0 comments on commit eed415b

Please sign in to comment.