Skip to content

Commit cc503cb

Browse files
PavelSafronovdurranbaileympearson
authored
feat(NODE-7306): Replace global process with import node:process (#4820)
Co-authored-by: Durran Jordan <[email protected]> Co-authored-by: Bailey Pearson <[email protected]>
1 parent 364628d commit cc503cb

File tree

91 files changed

+123
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+123
-25
lines changed

.eslintrc.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
{
5151
"name": "setInterval",
5252
"message": "Use `import { setInterval } from 'timers';` instead"
53+
},
54+
{
55+
"name": "process",
56+
"message": "Use `import * as process from 'process';` instead"
5357
}
5458
],
5559
"prettier/prettier": "error",
@@ -95,6 +99,10 @@
9599
{
96100
"name": "..",
97101
"message": "Please import directly from the relevant file instead."
102+
},
103+
{
104+
"name": "node:*",
105+
"message": "Don't use `node:*`; use bare Node core module names instead."
98106
}
99107
]
100108
}
@@ -267,7 +275,8 @@
267275
{
268276
"patterns": [
269277
"**/../lib/**",
270-
"mongodb-mock-server"
278+
"mongodb-mock-server",
279+
"node:*"
271280
],
272281
"paths": [
273282
{
@@ -318,4 +327,4 @@
318327
}
319328
}
320329
]
321-
}
330+
}

.github/scripts/highlights.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-check
2-
import * as process from 'node:process';
2+
import * as process from 'process';
33
import { output } from './util.mjs';
44

55
const {

.github/scripts/nightly.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import * as url from 'node:url';
33
import * as fs from 'node:fs/promises';
44
import * as path from 'node:path';
5-
import * as process from 'node:process';
5+
import * as process from 'process';
66
import * as child_process from 'node:child_process';
77
import * as util from 'node:util';
88
import { output } from './util.mjs';

.github/scripts/release_notes.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import * as url from 'node:url';
33
import * as fs from 'node:fs/promises';
44
import * as path from 'node:path';
5-
import * as process from 'node:process';
5+
import * as process from 'process';
66
import * as semver from 'semver';
77
import { getCurrentHistorySection, output } from './util.mjs';
88

@@ -50,7 +50,7 @@ const releaseNotesPath = path.join(process.cwd(), 'release_notes.md');
5050
await fs.writeFile(
5151
releaseNotesPath,
5252
`:seedling: A new release!\n---\n${releaseNotes}\n---\n`,
53-
{ encoding:'utf8' }
53+
{ encoding: 'utf8' }
5454
);
5555

5656
await output('release_notes_path', releaseNotesPath)

.github/scripts/util.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-check
2-
import * as process from 'node:process';
2+
import * as process from 'process';
33
import * as fs from 'node:fs/promises';
44

55
export async function output(key, value) {

src/client-side-encryption/state_machine.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as fs from 'fs/promises';
22
import { type MongoCryptContext, type MongoCryptKMSRequest } from 'mongodb-client-encryption';
33
import * as net from 'net';
4+
import * as process from 'process';
45
import * as tls from 'tls';
56

67
import {

src/cmap/auth/aws_temporary_credentials.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import * as process from 'process';
2+
13
import { type AWSCredentials, getAwsCredentialProvider } from '../../deps';
24
import { MongoAWSError } from '../../error';
35

src/cmap/auth/mongodb_oidc/k8s_machine_workflow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { readFile } from 'fs/promises';
2+
import * as process from 'process';
23

34
import type { OIDCCallbackFunction, OIDCResponse } from '../mongodb_oidc';
45

src/cmap/auth/mongodb_oidc/token_machine_workflow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as fs from 'fs';
2+
import * as process from 'process';
23

34
import { MongoAWSError } from '../../../error';
45
import type { OIDCCallbackFunction, OIDCResponse } from '../mongodb_oidc';

src/connection_string.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as dns from 'dns';
22
import ConnectionString from 'mongodb-connection-string-url';
3+
import * as process from 'process';
34
import { URLSearchParams } from 'url';
45

56
import type { Document } from './bson';

0 commit comments

Comments
 (0)