refactor: use node scheme imports in scripts (#38846)

* refactor: use node scheme imports in script

* refactor: use node scheme imports in build
This commit is contained in:
Milan Burda 2023-06-22 16:21:42 +02:00 committed by GitHub
parent 395b608dd5
commit abec9ead06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 105 additions and 89 deletions

View file

@ -1,6 +1,6 @@
if (!process.env.CI) require('dotenv-safe').load();
const assert = require('assert');
const assert = require('node:assert');
const got = require('got');
const { Octokit } = require('@octokit/rest');

View file

@ -1,5 +1,5 @@
const got = require('got');
const url = require('url');
const url = require('node:url');
module.exports = async function getUrlHash (targetUrl, algorithm = 'sha256', attempts = 3) {
const options = {

View file

@ -2,7 +2,7 @@
const { GitProcess } = require('dugite');
const minimist = require('minimist');
const path = require('path');
const path = require('node:path');
const semver = require('semver');
const { ELECTRON_DIR } = require('../../lib/utils');

View file

@ -2,8 +2,8 @@
'use strict';
const fs = require('fs');
const path = require('path');
const fs = require('node:fs');
const path = require('node:path');
const { GitProcess } = require('dugite');

View file

@ -6,11 +6,11 @@ const args = require('minimist')(process.argv.slice(2), {
});
const ciReleaseBuild = require('./ci-release-build');
const { Octokit } = require('@octokit/rest');
const { execSync } = require('child_process');
const { execSync } = require('node:child_process');
const { GitProcess } = require('dugite');
const path = require('path');
const readline = require('readline');
const path = require('node:path');
const readline = require('node:readline');
const releaseNotesGenerator = require('./notes/index.js');
const { getCurrentBranch, ELECTRON_DIR } = require('../lib/utils.js');
const bumpType = args._[0];

View file

@ -1,7 +1,7 @@
const temp = require('temp');
const fs = require('fs');
const path = require('path');
const childProcess = require('child_process');
const fs = require('node:fs');
const path = require('node:path');
const childProcess = require('node:child_process');
const got = require('got');
const semver = require('semver');

View file

@ -5,7 +5,7 @@ const args = require('minimist')(process.argv.slice(2), {
string: ['tag', 'releaseID'],
default: { releaseID: '' }
});
const { execSync } = require('child_process');
const { execSync } = require('node:child_process');
const { GitProcess } = require('dugite');
const { getCurrentBranch, ELECTRON_DIR } = require('../lib/utils.js');
const { Octokit } = require('@octokit/rest');

View file

@ -9,13 +9,13 @@ const args = require('minimist')(process.argv.slice(2), {
],
default: { verboseNugget: false }
});
const fs = require('fs');
const { execSync } = require('child_process');
const fs = require('node:fs');
const { execSync } = require('node:child_process');
const got = require('got');
const path = require('path');
const path = require('node:path');
const semver = require('semver');
const temp = require('temp').track();
const { URL } = require('url');
const { URL } = require('node:url');
const { BlobServiceClient } = require('@azure/storage-blob');
const { Octokit } = require('@octokit/rest');

View file

@ -1,5 +1,5 @@
import { Octokit } from '@octokit/rest';
import * as fs from 'fs';
import * as fs from 'node:fs';
const octokit = new Octokit({
auth: process.env.ELECTRON_GITHUB_TOKEN

View file

@ -1,8 +1,8 @@
const path = require('path');
const fs = require('fs');
const path = require('node:path');
const fs = require('node:fs');
const semver = require('semver');
const { GitProcess } = require('dugite');
const { promisify } = require('util');
const { promisify } = require('node:util');
const { ELECTRON_DIR } = require('../lib/utils');