mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Migrate Node.js builtin imports to node: scheme (#57611)
Summary: Pull Request resolved: https://github.com/react/react-native/pull/57611 Directly follows D112733139 (Metro). **Motivation** - New Node builtins are *only* available under the prefix (e.g. `node:sqlite`), as this allows Node to introduce them without ecosystem-breaking changes, so this is the direction of travel and the only choice that'll allow consistency. - Encouraging them and grouping them separately makes it easier to reason about a module's 3rd party dependencies. Changelog: [Internal] Reviewed By: robhogan Differential Revision: D112803684 fbshipit-source-id: 40668d746a7151b3aa4800ff8af997902a18d198
This commit is contained in:
1 parent
94d208d96f
commit
89300acb9c
271 files changed
+822
-581
No files matched your search
@@ -18,15 +18,15 @@ const {
|
||||
getTypeScriptCompilerOptions,
|
||||
} = require('./config');
|
||||
const babel = require('@babel/core');
|
||||
const {spawn} = require('child_process');
|
||||
const translate = require('flow-api-translator');
|
||||
const {promises: fs} = require('fs');
|
||||
const micromatch = require('micromatch');
|
||||
const path = require('path');
|
||||
const {spawn} = require('node:child_process');
|
||||
const {promises: fs} = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const {parseArgs, styleText} = require('node:util');
|
||||
const prettier = require('prettier');
|
||||
const {globSync} = require('tinyglobby');
|
||||
const ts = require('typescript');
|
||||
const {parseArgs, styleText} = require('util');
|
||||
|
||||
const SRC_DIR = 'src';
|
||||
const BUILD_DIR = 'dist';
|
||||
|
||||
@@ -12,9 +12,9 @@ require('../shared/babelRegister').registerForScript();
|
||||
|
||||
const {BUILD_DIR, PACKAGES_DIR} = require('./build');
|
||||
const {buildConfig} = require('./config');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const {parseArgs} = require('util');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const {parseArgs} = require('node:util');
|
||||
|
||||
const config = {
|
||||
options: {
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
require('../shared/babelRegister').registerForScript();
|
||||
|
||||
const {promises: fs} = require('fs');
|
||||
const path = require('path');
|
||||
const {promises: fs} = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
// "prepack" script to prepare JavaScript packages for publishing.
|
||||
//
|
||||
|
||||
@@ -11,18 +11,18 @@
|
||||
const {PACKAGES_DIR} = require('../shared/consts');
|
||||
// $FlowFixMe[untyped-import]: TODO type ansi-styles
|
||||
const ansiStyles = require('ansi-styles');
|
||||
const {execSync, spawnSync} = require('child_process');
|
||||
const {promises: fs} = require('fs');
|
||||
const {execSync, spawnSync} = require('node:child_process');
|
||||
const {promises: fs} = require('node:fs');
|
||||
const {hostname, tmpdir, userInfo} = require('node:os');
|
||||
const path = require('node:path');
|
||||
const {parseArgs, styleText} = require('node:util');
|
||||
const nullthrows = require('nullthrows');
|
||||
const {hostname, tmpdir, userInfo} = require('os');
|
||||
const path = require('path');
|
||||
// $FlowFixMe[untyped-import]: TODO type rimraf
|
||||
const rimraf = require('rimraf');
|
||||
// $FlowFixMe[untyped-import]: TODO type signedsource
|
||||
const SignedSource = require('signedsource');
|
||||
// $FlowFixMe[untyped-import]: TODO type supports-color
|
||||
const supportsColor = require('supports-color');
|
||||
const {parseArgs, styleText} = require('util');
|
||||
|
||||
const DEVTOOLS_FRONTEND_REPO_URL =
|
||||
'https://github.com/react/react-native-devtools-frontend';
|
||||
|
||||
@@ -28,10 +28,10 @@ if (isMetaInternal) {
|
||||
}
|
||||
|
||||
const {packager} = require('@electron/packager');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const util = require('node:util');
|
||||
const signedsource = require('signedsource');
|
||||
const util = require('util');
|
||||
|
||||
const APP_NAME = 'React Native DevTools';
|
||||
const COMPANY_NAME = 'Meta Platforms Technologies LLC';
|
||||
|
||||
@@ -20,11 +20,11 @@ const {
|
||||
VERDACCIO_STORAGE_PATH,
|
||||
setupVerdaccio,
|
||||
} = require('./utils/verdaccio');
|
||||
const {execSync} = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const {execSync} = require('node:child_process');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const {parseArgs, styleText} = require('node:util');
|
||||
const {popd, pushd} = require('shelljs');
|
||||
const {parseArgs, styleText} = require('util');
|
||||
|
||||
const config = {
|
||||
options: {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @noflow
|
||||
*/
|
||||
|
||||
const {spawnSync} = require('child_process');
|
||||
const {spawnSync} = require('node:child_process');
|
||||
|
||||
async function retry(command, options, maxRetries, delay, args) {
|
||||
for (let i = 1; i <= maxRetries; i++) {
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
'use strict';
|
||||
|
||||
const {REPO_ROOT} = require('../../shared/consts');
|
||||
const {execSync, spawn} = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const {execSync, spawn} = require('node:child_process');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const NPM_CONFIG_PATH = path.join(REPO_ROOT, '.npmrc');
|
||||
const VERDACCIO_CONFIG_PATH = path.join(__dirname, '..', 'verdaccio.yml');
|
||||
|
||||
@@ -22,13 +22,13 @@ const {
|
||||
ExtractorConfig,
|
||||
// $FlowFixMe[cannot-resolve-module]
|
||||
} = require('@microsoft/api-extractor');
|
||||
const {promises: fs} = require('fs');
|
||||
const {diff} = require('jest-diff');
|
||||
const path = require('path');
|
||||
const {promises: fs} = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const {styleText} = require('node:util');
|
||||
const prettier = require('prettier');
|
||||
const osTempDir = require('temp-dir');
|
||||
const {globSync} = require('tinyglobby');
|
||||
const {styleText} = require('util');
|
||||
|
||||
const inputFilesPostTransforms: ReadonlyArray<PluginObj<unknown>> = [
|
||||
require('./transforms/typescript/renameDefaultExportedIdentifiers'),
|
||||
|
||||
@@ -13,10 +13,10 @@ const {ENTRY_POINT, IGNORE_PATTERNS, TYPES_OUTPUT_DIR} = require('../config');
|
||||
const getRequireStack = require('./resolution/getRequireStack');
|
||||
const translatedModuleTemplate = require('./templates/translatedModule.d.ts-template');
|
||||
const translateSourceFile = require('./translateSourceFile');
|
||||
const {promises: fs, watch: fsWatch} = require('fs');
|
||||
const micromatch = require('micromatch');
|
||||
const path = require('path');
|
||||
const {styleText} = require('util');
|
||||
const {promises: fs, watch: fsWatch} = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const {styleText} = require('node:util');
|
||||
|
||||
/**
|
||||
* Build generated TypeScript types for react-native.
|
||||
|
||||
@@ -16,7 +16,7 @@ const {
|
||||
watchGeneratedTypes,
|
||||
} = require('./buildGeneratedTypes');
|
||||
const debug = require('debug');
|
||||
const {parseArgs, styleText} = require('util');
|
||||
const {parseArgs, styleText} = require('node:util');
|
||||
|
||||
const config = {
|
||||
options: {
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
const {REPO_ROOT} = require('../../../shared/consts');
|
||||
const debug = require('debug')('build-types:resolution');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const TYPEDEF_MAPPING: Record<string, ReadonlyArray<string>> = {
|
||||
'.android.js': ['.js.flow', '.js'],
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
const {PACKAGES_DIR} = require('../../../shared/consts');
|
||||
const {getPackages} = require('../../../shared/monorepoUtils');
|
||||
const {existsSync} = require('fs');
|
||||
const path = require('path');
|
||||
const {existsSync} = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
export type DependencyContext = Readonly<{
|
||||
reportUnresolvedDependency(importPath: string): void,
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@
|
||||
|
||||
const organizeDeclarations = require('../organizeDeclarations');
|
||||
const babel = require('@babel/core');
|
||||
const {promises: fs} = require('fs');
|
||||
const path = require('path');
|
||||
const {promises: fs} = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
async function translate(code: string): Promise<string> {
|
||||
const result = await babel.transformAsync(code, {
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
const sortPropertiesVisitor = require('../sortProperties');
|
||||
const babel = require('@babel/core');
|
||||
const {promises: fs} = require('fs');
|
||||
const path = require('path');
|
||||
const {promises: fs} = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
async function translate(code: string): Promise<string> {
|
||||
const result = await babel.transformAsync(code, {
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
const sortUnionsVisitor = require('../sortUnions');
|
||||
const babel = require('@babel/core');
|
||||
const {promises: fs} = require('fs');
|
||||
const path = require('path');
|
||||
const {promises: fs} = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
async function translate(code: string): Promise<string> {
|
||||
const result = await babel.transformAsync(code, {
|
||||
|
||||
@@ -14,8 +14,8 @@ const generate = require('@babel/generator').default;
|
||||
const {parse} = require('@babel/parser');
|
||||
const traverse = require('@babel/traverse').default;
|
||||
const t = require('@babel/types');
|
||||
const {createHash} = require('crypto');
|
||||
const debug = require('debug')('build-types:transforms:versionExportedApis');
|
||||
const {createHash} = require('node:crypto');
|
||||
|
||||
/**
|
||||
* A visitor that annotates all exported types in the API snapshot with a
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
const resolveCyclicImportsInDefinition = require('../resolveCyclicImportsInDefinition');
|
||||
const path = require('path');
|
||||
const path = require('node:path');
|
||||
|
||||
const packagesPath = '/path/to/package/definition/files';
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import type {PluginObj} from '@babel/core';
|
||||
|
||||
import * as babel from '@babel/core';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
|
||||
type PackageConfig = ReadonlyArray<{
|
||||
directory: string,
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
require('../../shared/babelRegister').registerForScript();
|
||||
|
||||
const {diffApiSnapshot} = require('./diffApiSnapshot');
|
||||
const fs = require('fs');
|
||||
const {parseArgs} = require('util');
|
||||
const fs = require('node:fs');
|
||||
const {parseArgs} = require('node:util');
|
||||
|
||||
const config = {
|
||||
allowPositionals: true,
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
getReactNativePackage,
|
||||
getWorkspaceRoot,
|
||||
} from '../../shared/monorepoUtils';
|
||||
import path from 'path';
|
||||
import path from 'node:path';
|
||||
import {globSync} from 'tinyglobby';
|
||||
|
||||
describe('package manifests', () => {
|
||||
|
||||
@@ -26,10 +26,10 @@ const {
|
||||
prepareArtifacts,
|
||||
setupGHAArtifacts,
|
||||
} = require('./utils/testing-utils');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const {styleText} = require('node:util');
|
||||
const {cd, exec, popd, pushd, pwd, sed} = require('shelljs');
|
||||
const {styleText} = require('util');
|
||||
const yargs = require('yargs');
|
||||
|
||||
/* ::
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const {execSync: exec} = require('child_process');
|
||||
const fetch = require('node-fetch');
|
||||
const {styleText} = require('util');
|
||||
const {execSync: exec} = require('node:child_process');
|
||||
const {styleText} = require('node:util');
|
||||
|
||||
/*::
|
||||
type CIHeaders = {
|
||||
|
||||
@@ -14,11 +14,11 @@ const {
|
||||
generateAndroidArtifacts,
|
||||
} = require('../../releases/utils/release-utils');
|
||||
const ghaArtifactsUtils = require('./github-actions-utils.js');
|
||||
const fs = require('fs');
|
||||
// $FlowFixMe[cannot-resolve-module]
|
||||
const {spawn} = require('node:child_process');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('node:fs');
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
const {exec} = require('shelljs');
|
||||
|
||||
/*::
|
||||
|
||||
@@ -25,7 +25,7 @@ const getBranchName = jest.fn();
|
||||
|
||||
const {REPO_ROOT} = require('../../shared/consts');
|
||||
const {publishNpm} = require('../publish-npm');
|
||||
const path = require('path');
|
||||
const path = require('node:path');
|
||||
|
||||
let consoleLog;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ const execSync = jest.fn();
|
||||
const execMock = jest.fn();
|
||||
const fetchMock = jest.fn();
|
||||
|
||||
jest.mock('child_process', () => ({execSync}));
|
||||
jest.mock('node:child_process', () => ({execSync}));
|
||||
jest.mock('shelljs', () => ({exec: execMock}));
|
||||
jest.mock('../../shared/monorepoUtils', () => ({
|
||||
getPackages: getPackagesMock,
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
const {publishPackage} = require('../releases/utils/npm-utils');
|
||||
const {getPackages} = require('../shared/monorepoUtils');
|
||||
const {execSync} = require('child_process');
|
||||
const {parseArgs} = require('util');
|
||||
const {execSync} = require('node:child_process');
|
||||
const {parseArgs} = require('node:util');
|
||||
|
||||
const PUBLISH_PACKAGES_TAG = '#publish-packages-to-npm';
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
const readFileMock = jest.fn();
|
||||
const writeFileMock = jest.fn();
|
||||
|
||||
jest.mock('fs', () => ({
|
||||
...jest.requireActual<$FlowFixMe>('fs'),
|
||||
jest.mock('node:fs', () => ({
|
||||
...jest.requireActual<$FlowFixMe>('node:fs'),
|
||||
promises: {
|
||||
...jest.requireActual<$FlowFixMe>('fs').promises,
|
||||
...jest.requireActual<$FlowFixMe>('node:fs').promises,
|
||||
readFile: readFileMock,
|
||||
writeFile: writeFileMock,
|
||||
},
|
||||
@@ -22,7 +22,7 @@ jest.mock('fs', () => ({
|
||||
|
||||
const {REPO_ROOT} = require('../../shared/consts');
|
||||
const {updateReactNativeArtifacts} = require('../set-rn-artifacts-version');
|
||||
const path = require('path');
|
||||
const path = require('node:path');
|
||||
|
||||
describe('updateReactNativeArtifacts', () => {
|
||||
beforeAll(() => {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
const {setVersion} = require('../set-version');
|
||||
const path = require('path');
|
||||
const path = require('node:path');
|
||||
|
||||
jest.mock('../../shared/consts', () => ({
|
||||
REPO_ROOT: path.join(__dirname, '__fixtures__', 'set-version'),
|
||||
@@ -51,9 +51,9 @@ describe('setVersion', () => {
|
||||
});
|
||||
|
||||
beforeAll(() => {
|
||||
jest.mock('fs', () => {
|
||||
jest.mock('node:fs', () => {
|
||||
// $FlowFixMe[underconstrained-implicit-instantiation]
|
||||
const originalFs = jest.requireActual('fs');
|
||||
const originalFs = jest.requireActual('node:fs');
|
||||
|
||||
return {
|
||||
...originalFs,
|
||||
|
||||
@@ -19,10 +19,10 @@ const {
|
||||
removeCurlPaths,
|
||||
sanitizeSnapshots,
|
||||
} = require('./snapshot-utils');
|
||||
const fs = require('fs/promises');
|
||||
const http = require('http');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('node:fs/promises');
|
||||
const http = require('node:http');
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
|
||||
let server, serverUrl, tmpDir, consoleLog;
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ const {
|
||||
writeReleaseAssetUrlsToDotSlashFile,
|
||||
} = require('../write-dotslash-release-asset-urls');
|
||||
const {removeAnsiColors, sanitizeSnapshots} = require('./snapshot-utils');
|
||||
const fs = require('fs/promises');
|
||||
const http = require('http');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('node:fs/promises');
|
||||
const http = require('node:http');
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
const signedsource = require('signedsource');
|
||||
|
||||
let server, serverUrl, tmpDir, consoleLog;
|
||||
|
||||
@@ -17,7 +17,7 @@ const {
|
||||
writeReleaseAssetUrlsToDotSlashFiles,
|
||||
} = require('../releases/write-dotslash-release-asset-urls');
|
||||
const {parseVersion} = require('./utils/version-utils');
|
||||
const {execSync} = require('child_process');
|
||||
const {execSync} = require('node:child_process');
|
||||
const yargs = require('yargs');
|
||||
|
||||
async function main() {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
const {execSync} = require('child_process');
|
||||
const {execSync} = require('node:child_process');
|
||||
|
||||
/*::
|
||||
import type { Dependency, Destination, Platform } from './types';
|
||||
|
||||
@@ -18,9 +18,9 @@ const {
|
||||
stubSlicesFromXcframework,
|
||||
} = require('../../../packages/react-native/scripts/ios-prebuild/headers-xcframework');
|
||||
const {HEADERS_FOLDER, TARGET_FOLDER} = require('./constants');
|
||||
const {execSync} = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const {execSync} = require('node:child_process');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
/*::
|
||||
import type { Dependency, Platform } from './types';
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
import type {Dependency} from './types';
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const util = require('util');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const util = require('node:util');
|
||||
|
||||
const exec = util.promisify(require('child_process').exec);
|
||||
const exec = util.promisify(require('node:child_process').exec);
|
||||
|
||||
/**
|
||||
* Removes and recreates the given folder
|
||||
|
||||
@@ -15,17 +15,17 @@ const {
|
||||
SOURCE_FOLDER,
|
||||
TARGET_FOLDER,
|
||||
} = require('./constants');
|
||||
const {execSync} = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const {execSync} = require('node:child_process');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const util = require('node:util');
|
||||
const {globSync} = require('tinyglobby');
|
||||
const util = require('util');
|
||||
|
||||
/*::
|
||||
import type {Dependency} from './types';
|
||||
*/
|
||||
|
||||
const exec = util.promisify(require('child_process').exec);
|
||||
const exec = util.promisify(require('node:child_process').exec);
|
||||
|
||||
/**
|
||||
* This function downloads, prepares and creates the structure for the dependencies
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
*/
|
||||
|
||||
const {RESOURCES_FOLDER, TARGET_FOLDER} = require('./constants');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
/*::
|
||||
import type {Dependency} from './types';
|
||||
|
||||
@@ -14,7 +14,7 @@ const {createFramework} = require('./ios-prebuild/compose-framework');
|
||||
const {cleanFolder} = require('./ios-prebuild/folders');
|
||||
const {setupDependencies} = require('./ios-prebuild/setupDependencies');
|
||||
const {createSwiftPackageFile} = require('./ios-prebuild/swift-package');
|
||||
const path = require('path');
|
||||
const path = require('node:path');
|
||||
|
||||
require('../shared/babelRegister').registerForScript();
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ import type {BuildType, Version} from './utils/version-utils';
|
||||
const {getNpmInfo} = require('../releases/utils/npm-utils');
|
||||
const {REPO_ROOT} = require('../shared/consts');
|
||||
const {parseVersion, validateBuildType} = require('./utils/version-utils');
|
||||
const {promises: fs} = require('fs');
|
||||
const path = require('path');
|
||||
const {parseArgs} = require('util');
|
||||
const {promises: fs} = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const {parseArgs} = require('node:util');
|
||||
|
||||
const GRADLE_FILE_PATH = path.join(
|
||||
REPO_ROOT,
|
||||
|
||||
@@ -20,7 +20,7 @@ const {
|
||||
updatePackageJson,
|
||||
} = require('../shared/monorepoUtils');
|
||||
const {updateReactNativeArtifacts} = require('./set-rn-artifacts-version');
|
||||
const {parseArgs} = require('util');
|
||||
const {parseArgs} = require('node:util');
|
||||
|
||||
const config = {
|
||||
allowPositionals: true,
|
||||
|
||||
@@ -21,9 +21,9 @@ const {
|
||||
FIRST_PARTY_DOTSLASH_FILES,
|
||||
} = require('./write-dotslash-release-asset-urls');
|
||||
const {Octokit} = require('@octokit/rest');
|
||||
const path = require('node:path');
|
||||
const {parseArgs} = require('node:util');
|
||||
const nullthrows = require('nullthrows');
|
||||
const path = require('path');
|
||||
const {parseArgs} = require('util');
|
||||
|
||||
/*::
|
||||
import type {DotSlashProvider, DotSlashHttpProvider, DotSlashArtifactInfo} from './utils/dotslash-utils';
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
'use strict';
|
||||
|
||||
const {getWithCurl} = require('../curl-utils');
|
||||
const http = require('http');
|
||||
const http = require('node:http');
|
||||
|
||||
let server, serverUrl;
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ const {
|
||||
validateAndParseDotSlashFile,
|
||||
validateDotSlashArtifactData,
|
||||
} = require('../dotslash-utils');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('node:fs');
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
|
||||
jest.useRealTimers();
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@ jest
|
||||
process.exit(exitCode);
|
||||
},
|
||||
}))
|
||||
.mock('fs', () => ({
|
||||
.mock('node:fs', () => ({
|
||||
existsSync: jest.fn().mockImplementation(_ => true),
|
||||
}))
|
||||
.mock('path', () => ({
|
||||
.mock('node:path', () => ({
|
||||
dirname: jest
|
||||
.fn()
|
||||
.mockImplementation(filePath =>
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
'use strict';
|
||||
|
||||
const spawnAsync = require('@expo/spawn-async');
|
||||
const {promises: fs} = require('fs');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const {promises: fs} = require('node:fs');
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
|
||||
/*::
|
||||
type CurlResult = {
|
||||
|
||||
@@ -11,12 +11,14 @@
|
||||
'use strict';
|
||||
|
||||
const dotslash = require('fb-dotslash');
|
||||
const {promises: fs} = require('fs');
|
||||
const {applyEdits, modify, parse} = require('jsonc-parser');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const {promises: fs} = require('node:fs');
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
const execFile = require('node:util').promisify(
|
||||
require('node:child_process').execFile,
|
||||
);
|
||||
const signedsource = require('signedsource');
|
||||
const execFile = require('util').promisify(require('child_process').execFile);
|
||||
|
||||
/*::
|
||||
export type DotSlashHttpProvider = {
|
||||
|
||||
@@ -15,8 +15,8 @@ const {
|
||||
updatePackageJson,
|
||||
} = require('../../shared/monorepoUtils');
|
||||
const {getPackageVersionStrByTag} = require('./npm-utils');
|
||||
const {promises: fs} = require('fs');
|
||||
const path = require('path');
|
||||
const {promises: fs} = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const MAVEN_VERSIONS_FILE_PATH = path.join(
|
||||
REACT_NATIVE_PACKAGE_DIR,
|
||||
|
||||
@@ -20,8 +20,8 @@ const {
|
||||
const {
|
||||
FIRST_PARTY_DOTSLASH_FILES,
|
||||
} = require('./write-dotslash-release-asset-urls');
|
||||
const path = require('path');
|
||||
const {parseArgs, styleText} = require('util');
|
||||
const path = require('node:path');
|
||||
const {parseArgs, styleText} = require('node:util');
|
||||
|
||||
async function main() {
|
||||
const {
|
||||
|
||||
@@ -24,8 +24,8 @@ const {
|
||||
validateDotSlashArtifactData,
|
||||
} = require('./utils/dotslash-utils');
|
||||
const {diff: jestDiff} = require('jest-diff');
|
||||
const path = require('path');
|
||||
const {parseArgs} = require('util');
|
||||
const path = require('node:path');
|
||||
const {parseArgs} = require('node:util');
|
||||
|
||||
const FIRST_PARTY_DOTSLASH_FILES = [
|
||||
'packages/debugger-shell/bin/react-native-devtools',
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* --yarnBinary [path] - path to yarn binary, defaults to yarn
|
||||
*/
|
||||
|
||||
const {execSync} = require('child_process');
|
||||
const {execSync} = require('node:child_process');
|
||||
const argv /*:Readonly<{
|
||||
maxWorkers?: number,
|
||||
jestBinary?: string,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const path = require('node:path');
|
||||
|
||||
/**
|
||||
* The absolute path to the repo root.
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const childProcess = require('child_process');
|
||||
const childProcess = require('node:child_process');
|
||||
|
||||
function isGitRepo() /*: boolean */ {
|
||||
try {
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
*/
|
||||
|
||||
const {REACT_NATIVE_PACKAGE_DIR, REPO_ROOT} = require('./consts');
|
||||
const {promises: fs} = require('fs');
|
||||
const path = require('path');
|
||||
const {promises: fs} = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const {globSync} = require('tinyglobby');
|
||||
|
||||
const WORKSPACES_CONFIG = '{packages,private}/*';
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
// @flow
|
||||
const { execSync } = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { execSync } = require('node:child_process');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
function main() {
|
||||
const packageJsonPath = path.join(__dirname, '../packages/react-native/package.json');
|
||||
|
||||
Reference in new issue
Block a user