Files
Alex Hunt 89300acb9c 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
2026-07-21 09:01:41 -07:00

60 lines
1.2 KiB
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
const path = require('node:path');
/**
* The absolute path to the repo root.
*/
const REPO_ROOT /*: string */ = path.resolve(__dirname, '../..');
/**
* The absolute path to the packages directory (note: this directory alone may
* not match the "workspaces" config in package.json).
*/
const PACKAGES_DIR /*: string */ = path.join(REPO_ROOT, 'packages');
/**
* The absolute path to the repo private directory.
*/
const PRIVATE_DIR /*: string */ = path.join(REPO_ROOT, 'private');
/**
* The absolute path to the repo scripts directory.
*/
const SCRIPTS_DIR /*: string */ = path.join(REPO_ROOT, 'scripts');
/**
* The absolute path to the react-native package.
*/
const REACT_NATIVE_PACKAGE_DIR /*: string */ = path.join(
REPO_ROOT,
'packages',
'react-native',
);
/**
* The absolute path to the rn-tester package.
*/
const RN_TESTER_DIR /*: string */ = path.join(
REPO_ROOT,
'packages',
'rn-tester',
);
module.exports = {
PACKAGES_DIR,
PRIVATE_DIR,
REACT_NATIVE_PACKAGE_DIR,
REPO_ROOT,
RN_TESTER_DIR,
SCRIPTS_DIR,
};