first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadConfigAsync = void 0;
const require_utils_1 = require("@expo/require-utils");
const promises_1 = __importDefault(require("fs/promises"));
const path_1 = __importDefault(require("path"));
const memoize_1 = require("../memoize");
const utils_1 = require("../utils");
const mockedNativeModules = path_1.default.join(__dirname, '..', '..', 'node_modules_mock');
/**
* Load the `react-native.config.js` or `react-native.config.ts` from the package.
*/
exports.loadConfigAsync = (0, memoize_1.memoize)(async function loadConfigAsync(packageRoot) {
const configPath = (await Promise.all(['react-native.config.js', 'react-native.config.ts'].map(async (fileName) => {
const file = path_1.default.join(packageRoot, fileName);
return (await (0, utils_1.fileExistsAsync)(file)) ? file : null;
}))).find((path) => path != null);
if (configPath) {
const mod = (0, require_utils_1.evalModule)(await promises_1.default.readFile(configPath, 'utf8'), configPath,
// NOTE: We need to mock the Community CLI temporarily, because
// some packages are checking the version of the CLI in the `react-native.config.js` file.
// We can remove this once we remove this check from packages.
{ paths: [mockedNativeModules] });
return mod.default ?? mod ?? null;
}
else {
return null;
}
});
//# sourceMappingURL=config.js.map