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

22
node_modules/@expo/config/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

16
node_modules/@expo/config/README.md generated vendored Normal file
View File

@@ -0,0 +1,16 @@
<!-- Title -->
<h1 align="center">
👋 Welcome to <br><code>@expo/config</code>
</h1>
<p align="center">A library for interacting with the <code>app.json</code>.</p>
<p align="center">
<img src="https://flat.badgen.net/packagephobia/install/@expo/config">
<a href="https://www.npmjs.com/package/@expo/config">
<img src="https://flat.badgen.net/npm/dw/@expo/config" target="_blank" />
</a>
</p>
<!-- Body -->

76
node_modules/@expo/config/build/Config.d.ts generated vendored Normal file
View File

@@ -0,0 +1,76 @@
import { ConfigFilePaths, ExpoConfig, GetConfigOptions, PackageJSONConfig, ProjectConfig, ProjectTarget, WriteConfigOptions } from './Config.types';
/**
* Evaluate the config for an Expo project.
* If a function is exported from the `app.config.js` then a partial config will be passed as an argument.
* The partial config is composed from any existing app.json, and certain fields from the `package.json` like name and description.
*
* If options.isPublicConfig is true, the Expo config will include only public-facing options (omitting private keys).
* The resulting config should be suitable for hosting or embedding in a publicly readable location.
*
* **Example**
* ```js
* module.exports = function({ config }) {
* // mutate the config before returning it.
* config.slug = 'new slug'
* return { expo: config };
* }
* ```
*
* **Supports**
* - `app.config.ts`
* - `app.config.js`
* - `app.config.json`
* - `app.json`
*
* @param projectRoot the root folder containing all of your application code
* @param options enforce criteria for a project config
*/
export declare function getConfig(projectRoot: string, options?: GetConfigOptions): ProjectConfig;
export declare function getPackageJson(projectRoot: string): PackageJSONConfig;
/**
* Get the static and dynamic config paths for a project. Also accounts for custom paths.
*
* @param projectRoot
*/
export declare function getConfigFilePaths(projectRoot: string): ConfigFilePaths;
/**
* Attempt to modify an Expo project config.
* This will only fully work if the project is using static configs only.
* Otherwise 'warn' | 'fail' will return with a message about why the config couldn't be updated.
* The potentially modified config object will be returned for testing purposes.
*
* @param projectRoot
* @param modifications modifications to make to an existing config
* @param readOptions options for reading the current config file
* @param writeOptions If true, the static config file will not be rewritten
*/
export declare function modifyConfigAsync(projectRoot: string, modifications: Partial<ExpoConfig>, readOptions?: GetConfigOptions, writeOptions?: WriteConfigOptions): Promise<{
type: 'success' | 'warn' | 'fail';
message?: string;
config: ExpoConfig | null;
}>;
export declare function getWebOutputPath(config?: {
[key: string]: any;
}): string;
export declare function getNameFromConfig(exp?: Record<string, any>): {
appName?: string;
webName?: string;
};
export declare function getDefaultTarget(projectRoot: string, exp?: Pick<ExpoConfig, 'sdkVersion'>): ProjectTarget;
/**
* Return a useful name describing the project config.
* - dynamic: app.config.js
* - static: app.json
* - custom path app config relative to root folder
* - both: app.config.js or app.json
*/
export declare function getProjectConfigDescription(projectRoot: string): string;
/**
* Returns a string describing the configurations used for the given project root.
* Will return null if no config is found.
*
* @param projectRoot
* @param projectConfig
*/
export declare function getProjectConfigDescriptionWithPaths(projectRoot: string, projectConfig: ConfigFilePaths): string;
export * from './Config.types';

641
node_modules/@expo/config/build/Config.js generated vendored Normal file
View File

@@ -0,0 +1,641 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
getConfig: true,
getPackageJson: true,
getConfigFilePaths: true,
modifyConfigAsync: true,
getWebOutputPath: true,
getNameFromConfig: true,
getDefaultTarget: true,
getProjectConfigDescription: true,
getProjectConfigDescriptionWithPaths: true
};
exports.getConfig = getConfig;
exports.getConfigFilePaths = getConfigFilePaths;
exports.getDefaultTarget = getDefaultTarget;
exports.getNameFromConfig = getNameFromConfig;
exports.getPackageJson = getPackageJson;
exports.getProjectConfigDescription = getProjectConfigDescription;
exports.getProjectConfigDescriptionWithPaths = getProjectConfigDescriptionWithPaths;
exports.getWebOutputPath = getWebOutputPath;
exports.modifyConfigAsync = modifyConfigAsync;
function _jsonFile() {
const data = _interopRequireDefault(require("@expo/json-file"));
_jsonFile = function () {
return data;
};
return data;
}
function _deepmerge() {
const data = _interopRequireDefault(require("deepmerge"));
_deepmerge = function () {
return data;
};
return data;
}
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
function _glob() {
const data = require("glob");
_glob = function () {
return data;
};
return data;
}
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _resolveFrom() {
const data = _interopRequireDefault(require("resolve-from"));
_resolveFrom = function () {
return data;
};
return data;
}
function _semver() {
const data = _interopRequireDefault(require("semver"));
_semver = function () {
return data;
};
return data;
}
function _slugify() {
const data = _interopRequireDefault(require("slugify"));
_slugify = function () {
return data;
};
return data;
}
function _getConfig() {
const data = require("./getConfig");
_getConfig = function () {
return data;
};
return data;
}
function _getExpoSDKVersion() {
const data = require("./getExpoSDKVersion");
_getExpoSDKVersion = function () {
return data;
};
return data;
}
function _withConfigPlugins() {
const data = require("./plugins/withConfigPlugins");
_withConfigPlugins = function () {
return data;
};
return data;
}
function _withInternal() {
const data = require("./plugins/withInternal");
_withInternal = function () {
return data;
};
return data;
}
function _resolvePackageJson() {
const data = require("./resolvePackageJson");
_resolvePackageJson = function () {
return data;
};
return data;
}
var _Config = require("./Config.types");
Object.keys(_Config).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _Config[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _Config[key];
}
});
});
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
let hasWarnedAboutRootConfig = false;
/**
* If a config has an `expo` object then that will be used as the config.
* This method reduces out other top level values if an `expo` object exists.
*
* @param config Input config object to reduce
*/
function reduceExpoObject(config) {
if (!config) return config || null;
if (config.expo && !hasWarnedAboutRootConfig) {
const keys = Object.keys(config).filter(key => key !== 'expo');
if (keys.length) {
hasWarnedAboutRootConfig = true;
const ansiYellow = str => `\u001B[33m${str}\u001B[0m`;
const ansiGray = str => `\u001B[90m${str}\u001B[0m`;
const ansiBold = str => `\u001B[1m${str}\u001B[22m`;
const plural = keys.length > 1;
console.warn(ansiYellow(ansiBold('Warning: ') + `Root-level ${ansiBold(`"expo"`)} object found. Ignoring extra key${plural ? 's' : ''} in Expo config: ${keys.map(key => `"${key}"`).join(', ')}\n` + ansiGray(`Learn more: https://expo.fyi/root-expo-object`)));
}
}
const {
mods,
...expo
} = config.expo ?? config;
return {
expo,
mods
};
}
/**
* Get all platforms that a project is currently capable of running.
*
* @param projectRoot
* @param exp
*/
function getSupportedPlatforms(projectRoot) {
const platforms = [];
if (_resolveFrom().default.silent(projectRoot, 'react-native')) {
platforms.push('ios', 'android');
}
if (_resolveFrom().default.silent(projectRoot, 'react-dom')) {
platforms.push('web');
}
return platforms;
}
/**
* Evaluate the config for an Expo project.
* If a function is exported from the `app.config.js` then a partial config will be passed as an argument.
* The partial config is composed from any existing app.json, and certain fields from the `package.json` like name and description.
*
* If options.isPublicConfig is true, the Expo config will include only public-facing options (omitting private keys).
* The resulting config should be suitable for hosting or embedding in a publicly readable location.
*
* **Example**
* ```js
* module.exports = function({ config }) {
* // mutate the config before returning it.
* config.slug = 'new slug'
* return { expo: config };
* }
* ```
*
* **Supports**
* - `app.config.ts`
* - `app.config.js`
* - `app.config.json`
* - `app.json`
*
* @param projectRoot the root folder containing all of your application code
* @param options enforce criteria for a project config
*/
function getConfig(projectRoot, options = {}) {
const paths = getConfigFilePaths(projectRoot);
const rawStaticConfig = paths.staticConfigPath ? (0, _getConfig().getStaticConfig)(paths.staticConfigPath) : null;
// For legacy reasons, always return an object.
const rootConfig = rawStaticConfig || {};
const staticConfig = reduceExpoObject(rawStaticConfig) || {};
// Can only change the package.json location if an app.json or app.config.json exists
const [packageJson, packageJsonPath] = getPackageJsonAndPath(projectRoot);
function fillAndReturnConfig(config, dynamicConfigObjectType, mayHaveUnusedStaticConfig = false) {
const configWithDefaultValues = {
...ensureConfigHasDefaultValues({
projectRoot,
exp: config.expo || {},
pkg: packageJson,
skipSDKVersionRequirement: options.skipSDKVersionRequirement,
paths,
packageJsonPath
}),
mods: config.mods,
dynamicConfigObjectType,
rootConfig,
dynamicConfigPath: paths.dynamicConfigPath,
staticConfigPath: paths.staticConfigPath,
hasUnusedStaticConfig: !!paths.staticConfigPath && !!paths.dynamicConfigPath && mayHaveUnusedStaticConfig
};
if (options.isModdedConfig) {
// @ts-ignore: Add the mods back to the object.
configWithDefaultValues.exp.mods = config.mods ?? null;
}
// Apply static json plugins, should be done after _internal
configWithDefaultValues.exp = (0, _withConfigPlugins().withConfigPlugins)(configWithDefaultValues.exp, !!options.skipPlugins);
if (!options.isModdedConfig) {
// @ts-ignore: Delete mods added by static plugins when they won't have a chance to be evaluated
delete configWithDefaultValues.exp.mods;
}
if (options.isPublicConfig) {
// TODD(EvanBacon): Drop plugins array after it's been resolved.
// Remove internal values with references to user's file paths from the public config.
delete configWithDefaultValues.exp._internal;
// hooks no longer exists in the typescript type but should still be removed
if ('hooks' in configWithDefaultValues.exp) {
delete configWithDefaultValues.exp.hooks;
}
if (configWithDefaultValues.exp.ios?.config) {
delete configWithDefaultValues.exp.ios.config;
}
if (configWithDefaultValues.exp.android?.config) {
delete configWithDefaultValues.exp.android.config;
}
delete configWithDefaultValues.exp.updates?.codeSigningCertificate;
delete configWithDefaultValues.exp.updates?.codeSigningMetadata;
}
return configWithDefaultValues;
}
// Fill in the static config
function getContextConfig(config) {
return ensureConfigHasDefaultValues({
projectRoot,
exp: config.expo || {},
pkg: packageJson,
skipSDKVersionRequirement: true,
paths,
packageJsonPath
}).exp;
}
if (paths.dynamicConfigPath) {
// No app.config.json or app.json but app.config.js
const {
exportedObjectType,
config: rawDynamicConfig,
mayHaveUnusedStaticConfig
} = (0, _getConfig().getDynamicConfig)(paths.dynamicConfigPath, {
projectRoot,
staticConfigPath: paths.staticConfigPath,
packageJsonPath,
config: getContextConfig(staticConfig)
});
// Allow for the app.config.js to `export default null;`
// Use `dynamicConfigPath` to detect if a dynamic config exists.
const dynamicConfig = reduceExpoObject(rawDynamicConfig) || {};
return fillAndReturnConfig(dynamicConfig, exportedObjectType, mayHaveUnusedStaticConfig);
}
// No app.config.js but json or no config
return fillAndReturnConfig(staticConfig || {}, null);
}
function getPackageJson(projectRoot) {
const [pkg] = getPackageJsonAndPath(projectRoot);
return pkg;
}
function getPackageJsonAndPath(projectRoot) {
const packageJsonPath = (0, _resolvePackageJson().getRootPackageJsonPath)(projectRoot);
return [_jsonFile().default.read(packageJsonPath), packageJsonPath];
}
/**
* Get the static and dynamic config paths for a project. Also accounts for custom paths.
*
* @param projectRoot
*/
function getConfigFilePaths(projectRoot) {
return {
dynamicConfigPath: getDynamicConfigFilePath(projectRoot),
staticConfigPath: getStaticConfigFilePath(projectRoot)
};
}
const DYNAMIC_CONFIG_EXTS = ['.ts', '.mts', '.cts', '.mjs', '.cjs', '.js'];
function getDynamicConfigFilePath(projectRoot) {
const fileNames = DYNAMIC_CONFIG_EXTS.map(ext => `app.config${ext}`);
for (const fileName of fileNames) {
const configPath = _path().default.join(projectRoot, fileName);
try {
const stat = _fs().default.statSync(configPath);
if (stat.isFile()) {
return configPath;
}
} catch {}
}
return null;
}
function getStaticConfigFilePath(projectRoot) {
for (const fileName of ['app.config.json', 'app.json']) {
const configPath = _path().default.join(projectRoot, fileName);
try {
const stat = _fs().default.statSync(configPath);
if (stat.isFile()) {
return configPath;
}
} catch {}
}
return null;
}
/**
* Attempt to modify an Expo project config.
* This will only fully work if the project is using static configs only.
* Otherwise 'warn' | 'fail' will return with a message about why the config couldn't be updated.
* The potentially modified config object will be returned for testing purposes.
*
* @param projectRoot
* @param modifications modifications to make to an existing config
* @param readOptions options for reading the current config file
* @param writeOptions If true, the static config file will not be rewritten
*/
async function modifyConfigAsync(projectRoot, modifications, readOptions = {}, writeOptions = {}) {
const config = getConfig(projectRoot, readOptions);
const isDryRun = writeOptions.dryRun;
// Create or modify the static config, when not using dynamic config
if (!config.dynamicConfigPath) {
const outputConfig = mergeConfigModifications(config, modifications);
if (!isDryRun) {
const configPath = config.staticConfigPath ?? _path().default.join(projectRoot, 'app.json');
await _jsonFile().default.writeAsync(configPath, outputConfig, {
json5: false
});
}
return {
type: 'success',
config: outputConfig.expo ?? outputConfig
};
}
// Attempt to write to a function-like dynamic config, when used with a static config
if (config.staticConfigPath && config.dynamicConfigObjectType === 'function' && !modifications.hasOwnProperty('plugins') // We don't know what plugins are in dynamic configs
) {
const outputConfig = mergeConfigModifications(config, modifications);
if (isDryRun) {
return {
type: 'warn',
message: `Cannot verify config modifications in dry-run mode for config at: ${_path().default.relative(projectRoot, config.dynamicConfigPath)}`,
config: null
};
}
// Attempt to write the static config with the config modifications
await _jsonFile().default.writeAsync(config.staticConfigPath, outputConfig, {
json5: false
});
// Verify that the dynamic config is using the static config
const newConfig = getConfig(projectRoot, readOptions);
const newConfighasModifications = isMatchingObject(modifications, newConfig.exp);
if (newConfighasModifications) {
return {
type: 'success',
config: newConfig.exp
};
}
// Rollback the changes when the reloaded config did not include the modifications
await _jsonFile().default.writeAsync(config.staticConfigPath, config.rootConfig, {
json5: false
});
}
// We cannot automatically write to a dynamic config
return {
type: 'warn',
message: `Cannot automatically write to dynamic config at: ${_path().default.relative(projectRoot, config.dynamicConfigPath)}`,
config: null
};
}
/**
* Merge the config modifications, using an optional possible top-level `expo` object.
* Note, changes in the plugins are merged differently to avoid duplicate entries.
*/
function mergeConfigModifications(config, {
plugins,
...modifications
}) {
const modifiedExpoConfig = !config.rootConfig.expo ? (0, _deepmerge().default)(config.rootConfig, modifications) : (0, _deepmerge().default)(config.rootConfig.expo, modifications);
if (plugins?.length) {
// When adding plugins, ensure the config has a plugin list
if (!modifiedExpoConfig.plugins) {
modifiedExpoConfig.plugins = [];
}
// Create a plugin lookup map
const existingPlugins = Object.fromEntries(modifiedExpoConfig.plugins.map(definition => typeof definition === 'string' ? [definition, undefined] : definition));
for (const plugin of plugins) {
// Unpack the plugin definition, using either the short (string) or normal (array) notation
const [pluginName, pluginProps] = Array.isArray(plugin) ? plugin : [plugin];
// Abort if the plugin definition is empty
if (!pluginName) continue;
// Add the plugin if it doesn't exist yet, including its properties
if (!(pluginName in existingPlugins)) {
modifiedExpoConfig.plugins.push(plugin);
continue;
}
// If the plugin has properties, and it exists, merge the properties
if (pluginProps) {
modifiedExpoConfig.plugins = modifiedExpoConfig.plugins.map(existingPlugin => {
const [existingPluginName] = Array.isArray(existingPlugin) ? existingPlugin : [existingPlugin];
// Do not modify other plugins
if (existingPluginName !== pluginName) {
return existingPlugin;
}
// Add the props to the existing plugin entry
if (typeof existingPlugin === 'string') {
return [existingPlugin, pluginProps];
}
// Merge the props to the existing plugin properties
if (Array.isArray(existingPlugin) && existingPlugin[0]) {
return [existingPlugin[0], (0, _deepmerge().default)(existingPlugin[1] ?? {}, pluginProps)];
}
return existingPlugin;
});
continue;
}
// If the same plugin exists with properties, and the modification does not contain properties, ignore
}
}
const finalizedConfig = !config.rootConfig.expo ? modifiedExpoConfig : {
...config.rootConfig,
expo: modifiedExpoConfig
};
return finalizedConfig;
}
function isMatchingObject(expectedValues, actualValues) {
for (const key in expectedValues) {
if (!expectedValues.hasOwnProperty(key)) {
continue;
}
if (typeof expectedValues[key] === 'object' && actualValues[key] !== null) {
if (!isMatchingObject(expectedValues[key], actualValues[key])) {
return false;
}
} else {
if (expectedValues[key] !== actualValues[key]) {
return false;
}
}
}
return true;
}
function ensureConfigHasDefaultValues({
projectRoot,
exp,
pkg,
paths,
packageJsonPath,
skipSDKVersionRequirement = false
}) {
if (!exp) {
exp = {};
}
exp = (0, _withInternal().withInternal)(exp, {
projectRoot,
...(paths ?? {}),
packageJsonPath
});
// Defaults for package.json fields
const pkgName = typeof pkg.name === 'string' ? pkg.name : _path().default.basename(projectRoot);
const pkgVersion = typeof pkg.version === 'string' ? pkg.version : '1.0.0';
const pkgWithDefaults = {
...pkg,
name: pkgName,
version: pkgVersion
};
// Defaults for app.json/app.config.js fields
const name = exp.name ?? pkgName;
const slug = exp.slug ?? (0, _slugify().default)(name.toLowerCase());
const version = exp.version ?? pkgVersion;
let description = exp.description;
if (!description && typeof pkg.description === 'string') {
description = pkg.description;
}
const expWithDefaults = {
...exp,
name,
slug,
version,
description
};
let sdkVersion;
try {
sdkVersion = (0, _getExpoSDKVersion().getExpoSDKVersion)(projectRoot, expWithDefaults);
} catch (error) {
if (!skipSDKVersionRequirement) throw error;
}
let platforms = exp.platforms;
if (!platforms) {
platforms = getSupportedPlatforms(projectRoot);
}
return {
exp: {
...expWithDefaults,
sdkVersion,
platforms
},
pkg: pkgWithDefaults
};
}
const DEFAULT_BUILD_PATH = `web-build`;
function getWebOutputPath(config = {}) {
if (process.env.WEBPACK_BUILD_OUTPUT_PATH) {
return process.env.WEBPACK_BUILD_OUTPUT_PATH;
}
const expo = config.expo || config || {};
return expo?.web?.build?.output || DEFAULT_BUILD_PATH;
}
function getNameFromConfig(exp = {}) {
// For RN CLI support
const appManifest = exp.expo || exp;
const {
web = {}
} = appManifest;
// rn-cli apps use a displayName value as well.
const appName = exp.displayName || appManifest.displayName || appManifest.name;
const webName = web.name || appName;
return {
appName,
webName
};
}
function getDefaultTarget(projectRoot, exp) {
exp ??= getConfig(projectRoot, {
skipSDKVersionRequirement: true
}).exp;
// before SDK 37, always default to managed to preserve previous behavior
if (exp.sdkVersion && exp.sdkVersion !== 'UNVERSIONED' && _semver().default.lt(exp.sdkVersion, '37.0.0')) {
return 'managed';
}
return isBareWorkflowProject(projectRoot) ? 'bare' : 'managed';
}
function isBareWorkflowProject(projectRoot) {
const [pkg] = getPackageJsonAndPath(projectRoot);
// TODO: Drop this
if (pkg.dependencies && pkg.dependencies.expokit) {
return false;
}
const xcodeprojFiles = (0, _glob().sync)('ios/**/*.xcodeproj', {
absolute: true,
cwd: projectRoot
});
if (xcodeprojFiles.length) {
return true;
}
const gradleFiles = (0, _glob().sync)('android/**/*.gradle', {
absolute: true,
cwd: projectRoot
});
if (gradleFiles.length) {
return true;
}
return false;
}
/**
* Return a useful name describing the project config.
* - dynamic: app.config.js
* - static: app.json
* - custom path app config relative to root folder
* - both: app.config.js or app.json
*/
function getProjectConfigDescription(projectRoot) {
const paths = getConfigFilePaths(projectRoot);
return getProjectConfigDescriptionWithPaths(projectRoot, paths);
}
/**
* Returns a string describing the configurations used for the given project root.
* Will return null if no config is found.
*
* @param projectRoot
* @param projectConfig
*/
function getProjectConfigDescriptionWithPaths(projectRoot, projectConfig) {
if (projectConfig.dynamicConfigPath) {
const relativeDynamicConfigPath = _path().default.relative(projectRoot, projectConfig.dynamicConfigPath);
if (projectConfig.staticConfigPath) {
return `${relativeDynamicConfigPath} or ${_path().default.relative(projectRoot, projectConfig.staticConfigPath)}`;
}
return relativeDynamicConfigPath;
} else if (projectConfig.staticConfigPath) {
return _path().default.relative(projectRoot, projectConfig.staticConfigPath);
}
// If a config doesn't exist, our tooling will generate a static app.json
return 'app.json';
}
//# sourceMappingURL=Config.js.map

1
node_modules/@expo/config/build/Config.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

165
node_modules/@expo/config/build/Config.types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,165 @@
import type { ModConfig } from '@expo/config-plugins';
import type { ExpoConfig } from '@expo/config-types';
export type { ExpoConfig, Web as ExpoConfigWeb, Android as ExpoConfigAndroid, IOS as ExpoConfigIOS, Splash as ExpoConfigSplash, IOSIcons as ExpoConfigIOSIcons, AndroidIntentFiltersData as ExpoConfigAndroidIntentFiltersData, } from '@expo/config-types';
export type PackageJSONConfig = {
dependencies?: Record<string, string>;
[key: string]: any;
};
export interface ProjectConfig {
/**
* Fully evaluated Expo config with default values injected.
*/
exp: ExpoConfig;
/**
* Dynamic config for processing native files during the generation process.
*/
mods?: ModConfig | null;
/**
* Project package.json object with default values injected.
*/
pkg: PackageJSONConfig;
/**
* Unaltered static config (app.config.json, app.json, or custom json config).
* For legacy, an empty object will be returned even if no static config exists.
*/
rootConfig: AppJSONConfig;
/**
* Path to the static json config file if it exists.
* If a project has an app.config.js and an app.json then app.json will be returned.
* If a project has an app.config.json and an app.json then app.config.json will be returned.
* Returns null if no static config file exists.
*/
staticConfigPath: string | null;
/**
* Path to an app.config.js or app.config.ts.
* Returns null if no dynamic config file exists.
*/
dynamicConfigPath: string | null;
/**
* Returns the type of the value exported from the dynamic config.
* This can be used to determine if the dynamic config is potentially extending a static config when (v === 'function').
* Returns null if no dynamic config file exists.
*/
dynamicConfigObjectType: string | null;
/**
* Returns true if both a static and dynamic config are present, and the dynamic config is applied on top of the static.
* This is only used for expo-doctor diagnostic warnings. This flag may be true even in cases where all static config values are used.
* It only checks against a typical pattern for layering static and dynamic config, e.g.,:
* module.exports = ({ config }) => {
return {
...config,
name: 'name overridden by dynamic config',
};
};
*/
hasUnusedStaticConfig: boolean;
}
export type AppJSONConfig = {
expo: ExpoConfig;
[key: string]: any;
};
export type BareAppConfig = {
name: string;
[key: string]: any;
};
export type HookArguments = {
config: any;
url: any;
exp: ExpoConfig;
iosBundle: string | Uint8Array;
iosSourceMap: string | null;
iosManifest: any;
iosManifestUrl: string;
androidBundle: string | Uint8Array;
androidSourceMap: string | null;
androidManifest: any;
androidManifestUrl: string;
projectRoot: string;
log: (msg: any) => void;
};
export type ExpoGoConfig = {
mainModuleName: string;
debuggerHost: string;
developer: {
tool: string | null;
projectRoot?: string;
};
packagerOpts: {
[key: string]: any;
};
};
export type EASConfig = {
projectId?: string;
};
export type ClientScopingConfig = {
scopeKey?: string;
};
export interface ExpoUpdatesManifestAsset {
url: string;
key: string;
contentType: string;
hash?: string;
}
export interface ExpoUpdatesManifest {
id: string;
createdAt: string;
runtimeVersion: string;
launchAsset: ExpoUpdatesManifestAsset;
assets: ExpoUpdatesManifestAsset[];
metadata: {
[key: string]: string;
};
extra: ClientScopingConfig & {
expoClient?: ExpoConfig & {
/**
* Only present during development using @expo/cli.
*/
hostUri?: string;
};
expoGo?: ExpoGoConfig;
eas?: EASConfig;
};
}
export type Hook = {
file: string;
config: any;
};
export type HookType = 'postPublish' | 'postExport';
export declare enum ProjectPrivacy {
PUBLIC = "public",
UNLISTED = "unlisted"
}
export type Platform = 'android' | 'ios' | 'web';
export type ProjectTarget = 'managed' | 'bare';
export type ConfigErrorCode = 'NO_APP_JSON' | 'NOT_OBJECT' | 'NO_EXPO' | 'MODULE_NOT_FOUND' | 'DEPRECATED' | 'INVALID_MODE' | 'INVALID_FORMAT' | 'INVALID_PLUGIN' | 'INVALID_CONFIG' | 'ENTRY_NOT_FOUND';
export type ConfigContext = {
projectRoot: string;
/**
* The static config path either app.json, app.config.json, or a custom user-defined config.
*/
staticConfigPath: string | null;
packageJsonPath: string | null;
config: Partial<ExpoConfig>;
};
export type GetConfigOptions = {
isPublicConfig?: boolean;
/**
* Should the config `mods` be preserved in the config? Used for compiling mods in the eject command.
*
* @default false
*/
isModdedConfig?: boolean;
skipSDKVersionRequirement?: boolean;
/**
* Dangerously skip resolving plugins.
*/
skipPlugins?: boolean;
strict?: boolean;
};
export type WriteConfigOptions = {
dryRun?: boolean;
};
export type ConfigFilePaths = {
staticConfigPath: string | null;
dynamicConfigPath: string | null;
};

12
node_modules/@expo/config/build/Config.types.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ProjectPrivacy = void 0;
let ProjectPrivacy = exports.ProjectPrivacy = /*#__PURE__*/function (ProjectPrivacy) {
ProjectPrivacy["PUBLIC"] = "public";
ProjectPrivacy["UNLISTED"] = "unlisted";
return ProjectPrivacy;
}({});
//# sourceMappingURL=Config.types.js.map

1
node_modules/@expo/config/build/Config.types.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

11
node_modules/@expo/config/build/Errors.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
import { ConfigErrorCode } from './Config.types';
/**
* Based on `JsonFileError` from `@expo/json-file`
*/
export declare class ConfigError extends Error {
code: ConfigErrorCode;
cause?: Error | undefined;
readonly name = "ConfigError";
readonly isConfigError = true;
constructor(message: string, code: ConfigErrorCode, cause?: Error | undefined);
}

20
node_modules/@expo/config/build/Errors.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ConfigError = void 0;
/**
* Based on `JsonFileError` from `@expo/json-file`
*/
class ConfigError extends Error {
name = 'ConfigError';
isConfigError = true;
constructor(message, code, cause) {
super(cause ? `${message}\n└─ Cause: ${cause.name}: ${cause.message}` : message);
this.code = code;
this.cause = cause;
}
}
exports.ConfigError = ConfigError;
//# sourceMappingURL=Errors.js.map

1
node_modules/@expo/config/build/Errors.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Errors.js","names":["ConfigError","Error","name","isConfigError","constructor","message","code","cause","exports"],"sources":["../src/Errors.ts"],"sourcesContent":["import { ConfigErrorCode } from './Config.types';\n\n/**\n * Based on `JsonFileError` from `@expo/json-file`\n */\nexport class ConfigError extends Error {\n readonly name = 'ConfigError';\n readonly isConfigError = true;\n\n constructor(\n message: string,\n public code: ConfigErrorCode,\n public cause?: Error\n ) {\n super(cause ? `${message}\\n└─ Cause: ${cause.name}: ${cause.message}` : message);\n }\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACO,MAAMA,WAAW,SAASC,KAAK,CAAC;EAC5BC,IAAI,GAAG,aAAa;EACpBC,aAAa,GAAG,IAAI;EAE7BC,WAAWA,CACTC,OAAe,EACRC,IAAqB,EACrBC,KAAa,EACpB;IACA,KAAK,CAACA,KAAK,GAAG,GAAGF,OAAO,eAAeE,KAAK,CAACL,IAAI,KAAKK,KAAK,CAACF,OAAO,EAAE,GAAGA,OAAO,CAAC;IAAC,KAH1EC,IAAqB,GAArBA,IAAqB;IAAA,KACrBC,KAAa,GAAbA,KAAa;EAGtB;AACF;AAACC,OAAA,CAAAR,WAAA,GAAAA,WAAA","ignoreList":[]}

3
node_modules/@expo/config/build/Serialize.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export declare function serializeAndEvaluate(val: any): any;
export declare function serializeSkippingMods(val: any): any;
export declare function serializeAfterStaticPlugins(val: any): any;

92
node_modules/@expo/config/build/Serialize.js generated vendored Normal file
View File

@@ -0,0 +1,92 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.serializeAfterStaticPlugins = serializeAfterStaticPlugins;
exports.serializeAndEvaluate = serializeAndEvaluate;
exports.serializeSkippingMods = serializeSkippingMods;
function _Errors() {
const data = require("./Errors");
_Errors = function () {
return data;
};
return data;
}
function serializeAndEvaluate(val) {
if (['undefined', 'string', 'boolean', 'number', 'bigint'].includes(typeof val)) {
return val;
} else if (typeof val === 'function') {
// TODO: Bacon: Should we support async methods?
return val();
} else if (Array.isArray(val)) {
return val.map(serializeAndEvaluate);
} else if (typeof val === 'object') {
const output = {};
for (const property in val) {
if (val.hasOwnProperty(property)) {
output[property] = serializeAndEvaluate(val[property]);
}
}
return output;
}
// symbol
throw new (_Errors().ConfigError)(`Expo config doesn't support \`Symbols\`: ${val}`, 'INVALID_CONFIG');
}
function serializeSkippingMods(val) {
if (typeof val === 'object' && !Array.isArray(val)) {
const output = {};
for (const property in val) {
if (val.hasOwnProperty(property)) {
if (property === 'mods' || property === 'plugins') {
// Don't serialize mods or plugins
output[property] = val[property];
} else {
output[property] = serializeAndEvaluate(val[property]);
}
}
}
return output;
}
return serializeAndEvaluate(val);
}
function serializeAndEvaluatePlugin(val) {
if (['undefined', 'string', 'boolean', 'number', 'bigint'].includes(typeof val)) {
return val;
} else if (typeof val === 'function') {
return val.name || 'withAnonymous';
} else if (Array.isArray(val)) {
return val.map(serializeAndEvaluatePlugin);
} else if (typeof val === 'object') {
const output = {};
for (const property in val) {
if (val.hasOwnProperty(property)) {
output[property] = serializeAndEvaluatePlugin(val[property]);
}
}
return output;
}
// symbol
throw new (_Errors().ConfigError)(`Expo config doesn't support \`Symbols\`: ${val}`, 'INVALID_CONFIG');
}
function serializeAfterStaticPlugins(val) {
if (typeof val === 'object' && !Array.isArray(val)) {
const output = {};
for (const property in val) {
if (val.hasOwnProperty(property)) {
if (property === 'mods') {
// Don't serialize mods
output[property] = val[property];
} else if (property === 'plugins' && Array.isArray(val[property])) {
// Serialize the mods by removing any config plugins
output[property] = val[property].map(serializeAndEvaluatePlugin);
} else {
output[property] = serializeAndEvaluate(val[property]);
}
}
}
return output;
}
return serializeAndEvaluate(val);
}
//# sourceMappingURL=Serialize.js.map

1
node_modules/@expo/config/build/Serialize.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,78 @@
type AndroidRunOptions = {
variant?: string;
device?: boolean | string;
port?: number;
bundler?: boolean;
install?: boolean;
buildCache?: boolean;
allArch?: boolean;
binary?: string;
appId?: string;
};
type IosRunOptions = {
/** iOS device to target. */
device?: string | boolean;
/** Dev server port to use, ignored if `bundler` is `false`. */
port?: number;
/** Xcode scheme to build. */
scheme?: string | boolean;
/** Xcode configuration to build. Default `Debug` */
configuration?: 'Debug' | 'Release';
/** Should start the bundler dev server. */
bundler?: boolean;
/** Should install missing dependencies before building. */
install?: boolean;
/** Should use derived data for builds. */
buildCache?: boolean;
/** Path to an existing binary to install on the device. */
binary?: string;
/** Re-bundle JS and assets, then embed in existing app, and install again. */
rebundle?: boolean;
};
export type RunOptions = AndroidRunOptions | IosRunOptions;
export type ResolveBuildCacheProps = {
projectRoot: string;
platform: 'android' | 'ios';
runOptions: RunOptions;
fingerprintHash: string;
};
/**
* @deprecated Use `ResolveBuildCacheProps` instead.
*/
export type ResolveRemoteBuildCacheProps = ResolveBuildCacheProps;
export type UploadBuildCacheProps = {
projectRoot: string;
buildPath: string;
runOptions: RunOptions;
fingerprintHash: string;
platform: 'android' | 'ios';
};
/**
* @deprecated Use `ResolveBuildCacheProps` instead.
*/
export type UploadRemoteBuildCacheProps = UploadBuildCacheProps;
export type CalculateFingerprintHashProps = {
projectRoot: string;
platform: 'android' | 'ios';
runOptions: RunOptions;
};
export type BuildCacheProvider<T = any> = {
plugin: BuildCacheProviderPlugin<T>;
options: T;
};
export type BuildCacheProviderPlugin<T = any> = {
calculateFingerprintHash?: (props: CalculateFingerprintHashProps, options: T) => Promise<string | null>;
} & ({
resolveBuildCache(props: ResolveBuildCacheProps, options: T): Promise<string | null>;
uploadBuildCache(props: UploadBuildCacheProps, options: T): Promise<string | null>;
} | {
/**
* @deprecated Use `resolveBuildCache` instead.
*/
resolveRemoteBuildCache: (props: ResolveRemoteBuildCacheProps, options: T) => Promise<string | null>;
/**
* @deprecated Use `uploadBuildCache` instead.
*/
uploadRemoteBuildCache: (props: UploadRemoteBuildCacheProps, options: T) => Promise<string | null>;
});
export {};

View File

@@ -0,0 +1,2 @@
"use strict";
//# sourceMappingURL=buildCacheProvider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"buildCacheProvider.js","names":[],"sources":["../src/buildCacheProvider.ts"],"sourcesContent":["type AndroidRunOptions = {\n variant?: string;\n device?: boolean | string;\n port?: number;\n bundler?: boolean;\n install?: boolean;\n buildCache?: boolean;\n allArch?: boolean;\n binary?: string;\n appId?: string;\n};\n\ntype IosRunOptions = {\n /** iOS device to target. */\n device?: string | boolean;\n /** Dev server port to use, ignored if `bundler` is `false`. */\n port?: number;\n /** Xcode scheme to build. */\n scheme?: string | boolean;\n /** Xcode configuration to build. Default `Debug` */\n configuration?: 'Debug' | 'Release';\n /** Should start the bundler dev server. */\n bundler?: boolean;\n /** Should install missing dependencies before building. */\n install?: boolean;\n /** Should use derived data for builds. */\n buildCache?: boolean;\n /** Path to an existing binary to install on the device. */\n binary?: string;\n\n /** Re-bundle JS and assets, then embed in existing app, and install again. */\n rebundle?: boolean;\n};\n\nexport type RunOptions = AndroidRunOptions | IosRunOptions;\n\nexport type ResolveBuildCacheProps = {\n projectRoot: string;\n platform: 'android' | 'ios';\n runOptions: RunOptions;\n fingerprintHash: string;\n};\n\n/**\n * @deprecated Use `ResolveBuildCacheProps` instead.\n */\nexport type ResolveRemoteBuildCacheProps = ResolveBuildCacheProps;\n\nexport type UploadBuildCacheProps = {\n projectRoot: string;\n buildPath: string;\n runOptions: RunOptions;\n fingerprintHash: string;\n platform: 'android' | 'ios';\n};\n/**\n * @deprecated Use `ResolveBuildCacheProps` instead.\n */\nexport type UploadRemoteBuildCacheProps = UploadBuildCacheProps;\n\nexport type CalculateFingerprintHashProps = {\n projectRoot: string;\n platform: 'android' | 'ios';\n runOptions: RunOptions;\n};\n\nexport type BuildCacheProvider<T = any> = {\n plugin: BuildCacheProviderPlugin<T>;\n options: T;\n};\n\nexport type BuildCacheProviderPlugin<T = any> = {\n calculateFingerprintHash?: (\n props: CalculateFingerprintHashProps,\n options: T\n ) => Promise<string | null>;\n} & (\n | {\n resolveBuildCache(props: ResolveBuildCacheProps, options: T): Promise<string | null>;\n uploadBuildCache(props: UploadBuildCacheProps, options: T): Promise<string | null>;\n }\n | {\n /**\n * @deprecated Use `resolveBuildCache` instead.\n */\n resolveRemoteBuildCache: (\n props: ResolveRemoteBuildCacheProps,\n options: T\n ) => Promise<string | null>;\n /**\n * @deprecated Use `uploadBuildCache` instead.\n */\n uploadRemoteBuildCache: (\n props: UploadRemoteBuildCacheProps,\n options: T\n ) => Promise<string | null>;\n }\n);\n"],"mappings":"","ignoreList":[]}

1
node_modules/@expo/config/build/environment.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare const NON_STANDARD_SYMBOL: unique symbol;

8
node_modules/@expo/config/build/environment.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NON_STANDARD_SYMBOL = void 0;
const NON_STANDARD_SYMBOL = exports.NON_STANDARD_SYMBOL = Symbol('non-standard');
//# sourceMappingURL=environment.js.map

1
node_modules/@expo/config/build/environment.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"environment.js","names":["NON_STANDARD_SYMBOL","exports","Symbol"],"sources":["../src/environment.ts"],"sourcesContent":["export const NON_STANDARD_SYMBOL = Symbol('non-standard');\n"],"mappings":";;;;;;AAAO,MAAMA,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,MAAM,CAAC,cAAc,CAAC","ignoreList":[]}

31
node_modules/@expo/config/build/evalConfig.d.ts generated vendored Normal file
View File

@@ -0,0 +1,31 @@
import { AppJSONConfig, ConfigContext, ExpoConfig } from './Config.types';
type RawDynamicConfig = AppJSONConfig | Partial<ExpoConfig> | null;
export type DynamicConfigResults = {
config: RawDynamicConfig;
exportedObjectType: string;
mayHaveUnusedStaticConfig: boolean;
};
/**
* Transpile and evaluate the dynamic config object.
* This method is shared between the standard reading method in getConfig, and the headless script.
*
* @param options configFile path to the dynamic app.config.*, request to send to the dynamic config if it exports a function.
* @returns the serialized and evaluated config along with the exported object type (object or function).
*/
export declare function evalConfig(configFile: string, request: ConfigContext | null): DynamicConfigResults;
/**
* - Resolve the exported contents of an Expo config (be it default or module.exports)
* - Assert no promise exports
* - Return config type
* - Serialize config
*
* @param result
* @param configFile
* @param request
*/
export declare function resolveConfigExport(result: any, configFile: string, request: ConfigContext | null): {
config: any;
exportedObjectType: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
mayHaveUnusedStaticConfig: any;
};
export {};

100
node_modules/@expo/config/build/evalConfig.js generated vendored Normal file
View File

@@ -0,0 +1,100 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.evalConfig = evalConfig;
exports.resolveConfigExport = resolveConfigExport;
function _requireUtils() {
const data = require("@expo/require-utils");
_requireUtils = function () {
return data;
};
return data;
}
function _Errors() {
const data = require("./Errors");
_Errors = function () {
return data;
};
return data;
}
function _Serialize() {
const data = require("./Serialize");
_Serialize = function () {
return data;
};
return data;
}
function _environment() {
const data = require("./environment");
_environment = function () {
return data;
};
return data;
}
/**
* Transpile and evaluate the dynamic config object.
* This method is shared between the standard reading method in getConfig, and the headless script.
*
* @param options configFile path to the dynamic app.config.*, request to send to the dynamic config if it exports a function.
* @returns the serialized and evaluated config along with the exported object type (object or function).
*/
function evalConfig(configFile, request) {
const mod = (0, _requireUtils().loadModuleSync)(configFile);
return resolveConfigExport(mod, configFile, request);
}
/**
* - Resolve the exported contents of an Expo config (be it default or module.exports)
* - Assert no promise exports
* - Return config type
* - Serialize config
*
* @param result
* @param configFile
* @param request
*/
function resolveConfigExport(result, configFile, request) {
// add key to static config that we'll check for after the dynamic is evaluated
// to see if the static config was used in determining the dynamic
const hasBaseStaticConfig = _environment().NON_STANDARD_SYMBOL;
if (request?.config) {
// @ts-ignore
request.config[hasBaseStaticConfig] = true;
}
if (result.default != null) {
result = result.default;
}
const exportedObjectType = typeof result;
if (typeof result === 'function') {
result = result(request);
}
if (result instanceof Promise) {
throw new (_Errors().ConfigError)(`Config file ${configFile} cannot return a Promise.`, 'INVALID_CONFIG');
}
// If the key is not added, it suggests that the static config was not used as the base for the dynamic.
// note(Keith): This is the most common way to use static and dynamic config together, but not the only way.
// Hence, this is only output from getConfig() for informational purposes for use by tools like Expo Doctor
// to suggest that there *may* be a problem.
const mayHaveUnusedStaticConfig =
// @ts-ignore
request?.config?.[hasBaseStaticConfig] && !result?.[hasBaseStaticConfig];
if (result) {
delete result._hasBaseStaticConfig;
}
// If the expo object exists, ignore all other values.
if (result?.expo) {
result = (0, _Serialize().serializeSkippingMods)(result.expo);
} else {
result = (0, _Serialize().serializeSkippingMods)(result);
}
return {
config: result,
exportedObjectType,
mayHaveUnusedStaticConfig
};
}
//# sourceMappingURL=evalConfig.js.map

1
node_modules/@expo/config/build/evalConfig.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

4
node_modules/@expo/config/build/getConfig.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import { AppJSONConfig, ConfigContext, ExpoConfig } from './Config.types';
import { DynamicConfigResults } from './evalConfig';
export declare function getDynamicConfig(configPath: string, request: ConfigContext): DynamicConfigResults;
export declare function getStaticConfig(configPath: string): AppJSONConfig | ExpoConfig;

72
node_modules/@expo/config/build/getConfig.js generated vendored Normal file
View File

@@ -0,0 +1,72 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDynamicConfig = getDynamicConfig;
exports.getStaticConfig = getStaticConfig;
function _jsonFile() {
const data = _interopRequireDefault(require("@expo/json-file"));
_jsonFile = function () {
return data;
};
return data;
}
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _Errors() {
const data = require("./Errors");
_Errors = function () {
return data;
};
return data;
}
function _evalConfig() {
const data = require("./evalConfig");
_evalConfig = function () {
return data;
};
return data;
}
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
// We cannot use async config resolution right now because Next.js doesn't support async configs.
// If they don't add support for async Webpack configs then we may need to pull support for Next.js.
function readConfigFile(configFile, context) {
// If the file doesn't exist then we should skip it and continue searching.
if (!(0, _fs().existsSync)(configFile)) {
return null;
}
try {
return (0, _evalConfig().evalConfig)(configFile, context);
} catch (error) {
// @ts-ignore
error.isConfigError = true;
error.message = `Error reading Expo config at ${configFile}:\n\n${error.message}`;
throw error;
}
}
function getDynamicConfig(configPath, request) {
const config = readConfigFile(configPath, request);
if (config) {
// The config must be serialized and evaluated ahead of time so the spawned process can send it over.
return config;
}
// TODO: It seems this is only thrown if the file cannot be found (which may never happen).
// If so we should throw a more helpful error.
throw new (_Errors().ConfigError)(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');
}
function getStaticConfig(configPath) {
const config = _jsonFile().default.read(configPath, {
json5: true
});
if (config) {
return config;
}
throw new (_Errors().ConfigError)(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');
}
//# sourceMappingURL=getConfig.js.map

1
node_modules/@expo/config/build/getConfig.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"getConfig.js","names":["_jsonFile","data","_interopRequireDefault","require","_fs","_Errors","_evalConfig","e","__esModule","default","readConfigFile","configFile","context","existsSync","evalConfig","error","isConfigError","message","getDynamicConfig","configPath","request","config","ConfigError","getStaticConfig","JsonFile","read","json5"],"sources":["../src/getConfig.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport { existsSync } from 'fs';\n\nimport { AppJSONConfig, ConfigContext, ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\nimport { DynamicConfigResults, evalConfig } from './evalConfig';\n\n// We cannot use async config resolution right now because Next.js doesn't support async configs.\n// If they don't add support for async Webpack configs then we may need to pull support for Next.js.\nfunction readConfigFile(configFile: string, context: ConfigContext): null | DynamicConfigResults {\n // If the file doesn't exist then we should skip it and continue searching.\n if (!existsSync(configFile)) {\n return null;\n }\n try {\n return evalConfig(configFile, context);\n } catch (error: any) {\n // @ts-ignore\n error.isConfigError = true;\n error.message = `Error reading Expo config at ${configFile}:\\n\\n${error.message}`;\n throw error;\n }\n}\n\nexport function getDynamicConfig(configPath: string, request: ConfigContext): DynamicConfigResults {\n const config = readConfigFile(configPath, request);\n if (config) {\n // The config must be serialized and evaluated ahead of time so the spawned process can send it over.\n return config;\n }\n // TODO: It seems this is only thrown if the file cannot be found (which may never happen).\n // If so we should throw a more helpful error.\n throw new ConfigError(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');\n}\n\nexport function getStaticConfig(configPath: string): AppJSONConfig | ExpoConfig {\n const config = JsonFile.read(configPath, { json5: true });\n if (config) {\n return config as any;\n }\n throw new ConfigError(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,IAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,YAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgE,SAAAC,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE;AACA;AACA,SAASG,cAAcA,CAACC,UAAkB,EAAEC,OAAsB,EAA+B;EAC/F;EACA,IAAI,CAAC,IAAAC,gBAAU,EAACF,UAAU,CAAC,EAAE;IAC3B,OAAO,IAAI;EACb;EACA,IAAI;IACF,OAAO,IAAAG,wBAAU,EAACH,UAAU,EAAEC,OAAO,CAAC;EACxC,CAAC,CAAC,OAAOG,KAAU,EAAE;IACnB;IACAA,KAAK,CAACC,aAAa,GAAG,IAAI;IAC1BD,KAAK,CAACE,OAAO,GAAG,gCAAgCN,UAAU,QAAQI,KAAK,CAACE,OAAO,EAAE;IACjF,MAAMF,KAAK;EACb;AACF;AAEO,SAASG,gBAAgBA,CAACC,UAAkB,EAAEC,OAAsB,EAAwB;EACjG,MAAMC,MAAM,GAAGX,cAAc,CAACS,UAAU,EAAEC,OAAO,CAAC;EAClD,IAAIC,MAAM,EAAE;IACV;IACA,OAAOA,MAAM;EACf;EACA;EACA;EACA,MAAM,KAAIC,qBAAW,EAAC,6BAA6BH,UAAU,EAAE,EAAE,gBAAgB,CAAC;AACpF;AAEO,SAASI,eAAeA,CAACJ,UAAkB,EAA8B;EAC9E,MAAME,MAAM,GAAGG,mBAAQ,CAACC,IAAI,CAACN,UAAU,EAAE;IAAEO,KAAK,EAAE;EAAK,CAAC,CAAC;EACzD,IAAIL,MAAM,EAAE;IACV,OAAOA,MAAM;EACf;EACA,MAAM,KAAIC,qBAAW,EAAC,6BAA6BH,UAAU,EAAE,EAAE,gBAAgB,CAAC;AACpF","ignoreList":[]}

View File

@@ -0,0 +1,6 @@
import { ExpoConfig } from './Config.types';
/**
* Resolve the Expo SDK Version either from the input Expo config or from the installed
* version of the `expo` package.
*/
export declare function getExpoSDKVersion(projectRoot: string, exp?: Pick<ExpoConfig, 'sdkVersion'>): string;

59
node_modules/@expo/config/build/getExpoSDKVersion.js generated vendored Normal file
View File

@@ -0,0 +1,59 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getExpoSDKVersion = getExpoSDKVersion;
function _jsonFile() {
const data = _interopRequireDefault(require("@expo/json-file"));
_jsonFile = function () {
return data;
};
return data;
}
function _resolveFrom() {
const data = _interopRequireDefault(require("resolve-from"));
_resolveFrom = function () {
return data;
};
return data;
}
function _Errors() {
const data = require("./Errors");
_Errors = function () {
return data;
};
return data;
}
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/**
* Resolve the Expo SDK Version either from the input Expo config or from the installed
* version of the `expo` package.
*/
function getExpoSDKVersion(projectRoot, exp = {}) {
return exp?.sdkVersion ?? getExpoSDKVersionFromPackage(projectRoot);
}
/**
* Resolve the Expo SDK Version either from the input Expo config or from the installed
* version of the `expo` package.
*/
function getExpoSDKVersionFromPackage(projectRoot) {
const packageJsonPath = _resolveFrom().default.silent(projectRoot, 'expo/package.json');
if (!packageJsonPath) {
throw new (_Errors().ConfigError)(`Cannot determine the project's Expo SDK version because the module \`expo\` is not installed. Install it with \`npm install expo\` and try again.`, 'MODULE_NOT_FOUND');
}
const expoPackageJson = _jsonFile().default.read(packageJsonPath, {
json5: true
});
const {
version: packageVersion
} = expoPackageJson;
if (!(typeof packageVersion === 'string')) {
// This is technically impossible.
throw new (_Errors().ConfigError)(`Cannot determine the project's Expo SDK version because the module \`expo\` has an invalid package.json (missing \`version\` field). Try reinstalling node modules and trying again.`, 'MODULE_NOT_FOUND');
}
const majorVersion = packageVersion.split('.').shift();
return `${majorVersion}.0.0`;
}
//# sourceMappingURL=getExpoSDKVersion.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getExpoSDKVersion.js","names":["_jsonFile","data","_interopRequireDefault","require","_resolveFrom","_Errors","e","__esModule","default","getExpoSDKVersion","projectRoot","exp","sdkVersion","getExpoSDKVersionFromPackage","packageJsonPath","resolveFrom","silent","ConfigError","expoPackageJson","JsonFile","read","json5","version","packageVersion","majorVersion","split","shift"],"sources":["../src/getExpoSDKVersion.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\n\nimport { ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\n\n/**\n * Resolve the Expo SDK Version either from the input Expo config or from the installed\n * version of the `expo` package.\n */\nexport function getExpoSDKVersion(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'sdkVersion'> = {}\n): string {\n return exp?.sdkVersion ?? getExpoSDKVersionFromPackage(projectRoot);\n}\n\n/**\n * Resolve the Expo SDK Version either from the input Expo config or from the installed\n * version of the `expo` package.\n */\nfunction getExpoSDKVersionFromPackage(projectRoot: string): string {\n const packageJsonPath = resolveFrom.silent(projectRoot, 'expo/package.json');\n if (!packageJsonPath) {\n throw new ConfigError(\n `Cannot determine the project's Expo SDK version because the module \\`expo\\` is not installed. Install it with \\`npm install expo\\` and try again.`,\n 'MODULE_NOT_FOUND'\n );\n }\n const expoPackageJson = JsonFile.read(packageJsonPath, { json5: true });\n const { version: packageVersion } = expoPackageJson;\n\n if (!(typeof packageVersion === 'string')) {\n // This is technically impossible.\n throw new ConfigError(\n `Cannot determine the project's Expo SDK version because the module \\`expo\\` has an invalid package.json (missing \\`version\\` field). Try reinstalling node modules and trying again.`,\n 'MODULE_NOT_FOUND'\n );\n }\n\n const majorVersion = packageVersion.split('.').shift();\n return `${majorVersion}.0.0`;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuC,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEvC;AACA;AACA;AACA;AACO,SAASG,iBAAiBA,CAC/BC,WAAmB,EACnBC,GAAmC,GAAG,CAAC,CAAC,EAChC;EACR,OAAOA,GAAG,EAAEC,UAAU,IAAIC,4BAA4B,CAACH,WAAW,CAAC;AACrE;;AAEA;AACA;AACA;AACA;AACA,SAASG,4BAA4BA,CAACH,WAAmB,EAAU;EACjE,MAAMI,eAAe,GAAGC,sBAAW,CAACC,MAAM,CAACN,WAAW,EAAE,mBAAmB,CAAC;EAC5E,IAAI,CAACI,eAAe,EAAE;IACpB,MAAM,KAAIG,qBAAW,EACnB,mJAAmJ,EACnJ,kBACF,CAAC;EACH;EACA,MAAMC,eAAe,GAAGC,mBAAQ,CAACC,IAAI,CAACN,eAAe,EAAE;IAAEO,KAAK,EAAE;EAAK,CAAC,CAAC;EACvE,MAAM;IAAEC,OAAO,EAAEC;EAAe,CAAC,GAAGL,eAAe;EAEnD,IAAI,EAAE,OAAOK,cAAc,KAAK,QAAQ,CAAC,EAAE;IACzC;IACA,MAAM,KAAIN,qBAAW,EACnB,sLAAsL,EACtL,kBACF,CAAC;EACH;EAEA,MAAMO,YAAY,GAAGD,cAAc,CAACE,KAAK,CAAC,GAAG,CAAC,CAACC,KAAK,CAAC,CAAC;EACtD,OAAO,GAAGF,YAAY,MAAM;AAC9B","ignoreList":[]}

5
node_modules/@expo/config/build/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export * from './Config';
export * from './Config.types';
export * from './getExpoSDKVersion';
export * from './Errors';
export * from './buildCacheProvider';

61
node_modules/@expo/config/build/index.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Config = require("./Config");
Object.keys(_Config).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _Config[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _Config[key];
}
});
});
var _Config2 = require("./Config.types");
Object.keys(_Config2).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _Config2[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _Config2[key];
}
});
});
var _getExpoSDKVersion = require("./getExpoSDKVersion");
Object.keys(_getExpoSDKVersion).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _getExpoSDKVersion[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _getExpoSDKVersion[key];
}
});
});
var _Errors = require("./Errors");
Object.keys(_Errors).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _Errors[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _Errors[key];
}
});
});
var _buildCacheProvider = require("./buildCacheProvider");
Object.keys(_buildCacheProvider).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _buildCacheProvider[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _buildCacheProvider[key];
}
});
});
//# sourceMappingURL=index.js.map

1
node_modules/@expo/config/build/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["_Config","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_Config2","_getExpoSDKVersion","_Errors","_buildCacheProvider"],"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable import/export */\n\nexport * from './Config';\nexport * from './Config.types';\nexport * from './getExpoSDKVersion';\nexport * from './Errors';\nexport * from './buildCacheProvider';\n"],"mappings":";;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,QAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,QAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,QAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAA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config/build/paths/env.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
declare class Env {
/** Disable auto server root detection for Metro. This will not change the server root to the workspace root. */
get EXPO_NO_METRO_WORKSPACE_ROOT(): boolean;
}
export declare const env: Env;
export {};

24
node_modules/@expo/config/build/paths/env.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.env = void 0;
function _getenv() {
const data = require("getenv");
_getenv = function () {
return data;
};
return data;
}
class Env {
/** Disable auto server root detection for Metro. This will not change the server root to the workspace root. */
get EXPO_NO_METRO_WORKSPACE_ROOT() {
if ((0, _getenv().string)('EXPO_USE_METRO_WORKSPACE_ROOT', '')) {
console.warn('EXPO_USE_METRO_WORKSPACE_ROOT is enabled by default, use EXPO_NO_METRO_WORKSPACE_ROOT instead to disable.');
}
return (0, _getenv().boolish)('EXPO_NO_METRO_WORKSPACE_ROOT', false);
}
}
const env = exports.env = new Env();
//# sourceMappingURL=env.js.map

1
node_modules/@expo/config/build/paths/env.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"env.js","names":["_getenv","data","require","Env","EXPO_NO_METRO_WORKSPACE_ROOT","string","console","warn","boolish","env","exports"],"sources":["../../src/paths/env.ts"],"sourcesContent":["import { boolish, string } from 'getenv';\n\nclass Env {\n /** Disable auto server root detection for Metro. This will not change the server root to the workspace root. */\n get EXPO_NO_METRO_WORKSPACE_ROOT(): boolean {\n if (string('EXPO_USE_METRO_WORKSPACE_ROOT', '')) {\n console.warn(\n 'EXPO_USE_METRO_WORKSPACE_ROOT is enabled by default, use EXPO_NO_METRO_WORKSPACE_ROOT instead to disable.'\n );\n }\n\n return boolish('EXPO_NO_METRO_WORKSPACE_ROOT', false);\n }\n}\n\nexport const env = new Env();\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAME,GAAG,CAAC;EACR;EACA,IAAIC,4BAA4BA,CAAA,EAAY;IAC1C,IAAI,IAAAC,gBAAM,EAAC,+BAA+B,EAAE,EAAE,CAAC,EAAE;MAC/CC,OAAO,CAACC,IAAI,CACV,2GACF,CAAC;IACH;IAEA,OAAO,IAAAC,iBAAO,EAAC,8BAA8B,EAAE,KAAK,CAAC;EACvD;AACF;AAEO,MAAMC,GAAG,GAAAC,OAAA,CAAAD,GAAA,GAAG,IAAIN,GAAG,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,8 @@
export type LanguageOptions = {
isTS: boolean;
isModern: boolean;
isReact: boolean;
};
export declare function getExtensions(platforms: string[], extensions: string[], workflows: string[]): string[];
export declare function getLanguageExtensionsInOrder({ isTS, isModern, isReact, }: LanguageOptions): string[];
export declare function getBareExtensions(platforms: string[], languageOptions?: LanguageOptions): string[];

73
node_modules/@expo/config/build/paths/extensions.js generated vendored Normal file
View File

@@ -0,0 +1,73 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getBareExtensions = getBareExtensions;
exports.getExtensions = getExtensions;
exports.getLanguageExtensionsInOrder = getLanguageExtensionsInOrder;
function _assert() {
const data = _interopRequireDefault(require("assert"));
_assert = function () {
return data;
};
return data;
}
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function getExtensions(platforms, extensions, workflows) {
// In the past we used spread operators to collect the values so now we enforce type safety on them.
(0, _assert().default)(Array.isArray(platforms), 'Expected: `platforms: string[]`');
(0, _assert().default)(Array.isArray(extensions), 'Expected: `extensions: string[]`');
(0, _assert().default)(Array.isArray(workflows), 'Expected: `workflows: string[]`');
const fileExtensions = [];
// support .expo files
for (const workflow of [...workflows, '']) {
// Ensure order is correct: [platformA.js, platformB.js, js]
for (const platform of [...platforms, '']) {
// Support both TypeScript and JavaScript
for (const extension of extensions) {
fileExtensions.push([platform, workflow, extension].filter(Boolean).join('.'));
}
}
}
return fileExtensions;
}
function getLanguageExtensionsInOrder({
isTS,
isModern,
isReact
}) {
// @ts-ignore: filter removes false type
const addLanguage = lang => [lang, isReact && `${lang}x`].filter(Boolean);
// Support JavaScript
let extensions = addLanguage('js');
if (isModern) {
extensions.unshift('mjs');
}
if (isTS) {
extensions = [...addLanguage('ts'), ...extensions];
}
return extensions;
}
function getBareExtensions(platforms, languageOptions = {
isTS: true,
isModern: true,
isReact: true
}) {
const fileExtensions = getExtensions(platforms, getLanguageExtensionsInOrder(languageOptions), []);
// Always add these last
_addMiscellaneousExtensions(platforms, fileExtensions);
return fileExtensions;
}
function _addMiscellaneousExtensions(platforms, fileExtensions) {
// Always add these with no platform extension
// In the future we may want to add platform and workspace extensions to json.
fileExtensions.push('json');
// Native doesn't currently support web assembly.
if (platforms.includes('web')) {
fileExtensions.push('wasm');
}
return fileExtensions;
}
//# sourceMappingURL=extensions.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"extensions.js","names":["_assert","data","_interopRequireDefault","require","e","__esModule","default","getExtensions","platforms","extensions","workflows","assert","Array","isArray","fileExtensions","workflow","platform","extension","push","filter","Boolean","join","getLanguageExtensionsInOrder","isTS","isModern","isReact","addLanguage","lang","unshift","getBareExtensions","languageOptions","_addMiscellaneousExtensions","includes"],"sources":["../../src/paths/extensions.ts"],"sourcesContent":["import assert from 'assert';\n\nexport type LanguageOptions = {\n isTS: boolean;\n isModern: boolean;\n isReact: boolean;\n};\n\nexport function getExtensions(\n platforms: string[],\n extensions: string[],\n workflows: string[]\n): string[] {\n // In the past we used spread operators to collect the values so now we enforce type safety on them.\n assert(Array.isArray(platforms), 'Expected: `platforms: string[]`');\n assert(Array.isArray(extensions), 'Expected: `extensions: string[]`');\n assert(Array.isArray(workflows), 'Expected: `workflows: string[]`');\n\n const fileExtensions = [];\n // support .expo files\n for (const workflow of [...workflows, '']) {\n // Ensure order is correct: [platformA.js, platformB.js, js]\n for (const platform of [...platforms, '']) {\n // Support both TypeScript and JavaScript\n for (const extension of extensions) {\n fileExtensions.push([platform, workflow, extension].filter(Boolean).join('.'));\n }\n }\n }\n return fileExtensions;\n}\n\nexport function getLanguageExtensionsInOrder({\n isTS,\n isModern,\n isReact,\n}: LanguageOptions): string[] {\n // @ts-ignore: filter removes false type\n const addLanguage = (lang: string): string[] => [lang, isReact && `${lang}x`].filter(Boolean);\n\n // Support JavaScript\n let extensions = addLanguage('js');\n\n if (isModern) {\n extensions.unshift('mjs');\n }\n if (isTS) {\n extensions = [...addLanguage('ts'), ...extensions];\n }\n\n return extensions;\n}\n\nexport function getBareExtensions(\n platforms: string[],\n languageOptions: LanguageOptions = { isTS: true, isModern: true, isReact: true }\n): string[] {\n const fileExtensions = getExtensions(\n platforms,\n getLanguageExtensionsInOrder(languageOptions),\n []\n );\n // Always add these last\n _addMiscellaneousExtensions(platforms, fileExtensions);\n return fileExtensions;\n}\n\nfunction _addMiscellaneousExtensions(platforms: string[], fileExtensions: string[]): string[] {\n // Always add these with no platform extension\n // In the future we may want to add platform and workspace extensions to json.\n fileExtensions.push('json');\n // Native doesn't currently support web assembly.\n if (platforms.includes('web')) {\n fileExtensions.push('wasm');\n }\n return fileExtensions;\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAQrB,SAASG,aAAaA,CAC3BC,SAAmB,EACnBC,UAAoB,EACpBC,SAAmB,EACT;EACV;EACA,IAAAC,iBAAM,EAACC,KAAK,CAACC,OAAO,CAACL,SAAS,CAAC,EAAE,iCAAiC,CAAC;EACnE,IAAAG,iBAAM,EAACC,KAAK,CAACC,OAAO,CAACJ,UAAU,CAAC,EAAE,kCAAkC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C7C,EACF,CAAC;EACD;EACAC,2BAA2B,CAACvB,SAAS,EAAEM,cAAc,CAAC;EACtD,OAAOA,cAAc;AACvB;AAEA,SAASiB,2BAA2BA,CAACvB,SAAmB,EAAEM,cAAwB,EAAY;EAC5F;EACA;EACAA,cAAc,CAACI,IAAI,CAAC,MAAM,CAAC;EAC3B;EACA,IAAIV,SAAS,CAACwB,QAAQ,CAAC,KAAK,CAAC,EAAE;IAC7BlB,cAAc,CAACI,IAAI,CAAC,MAAM,CAAC;EAC7B;EACA,OAAOJ,cAAc;AACvB","ignoreList":[]}

2
node_modules/@expo/config/build/paths/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from './paths';
export * from './extensions';

28
node_modules/@expo/config/build/paths/index.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _paths = require("./paths");
Object.keys(_paths).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _paths[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _paths[key];
}
});
});
var _extensions = require("./extensions");
Object.keys(_extensions).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _extensions[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _extensions[key];
}
});
});
//# sourceMappingURL=index.js.map

1
node_modules/@expo/config/build/paths/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["_paths","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_extensions"],"sources":["../../src/paths/index.ts"],"sourcesContent":["export * from './paths';\nexport * from './extensions';\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,WAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,WAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,WAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,WAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}

27
node_modules/@expo/config/build/paths/paths.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
import { PackageJSONConfig } from '../Config.types';
export declare function ensureSlash(inputPath: string, needsSlash: boolean): string;
export declare function getPossibleProjectRoot(): string;
/** @returns the absolute entry file for an Expo project. */
export declare function resolveEntryPoint(projectRoot: string, { platform, pkg, }?: {
platform?: string;
pkg?: PackageJSONConfig;
}): string;
export declare function getFileWithExtensions(fromDirectory: string, moduleId: string, extensions: string[]): string | null;
/** Get the Metro server root, when working in monorepos */
export declare function getMetroServerRoot(projectRoot: string): string;
/**
* Get the workspace globs for Metro's watchFolders.
* @note This does not traverse the monorepo, and should be used with `getMetroServerRoot`
*/
export declare function getMetroWorkspaceGlobs(monorepoRoot: string): string[] | null;
/**
* Convert an absolute entry point to a server or project root relative filepath.
* This is useful on Android where the entry point is an absolute path.
*/
export declare function convertEntryPointToRelative(projectRoot: string, absolutePath: string): string;
/**
* Resolve the entry point relative to either the server or project root.
* This relative entry path should be used to pass non-absolute paths to Metro,
* accounting for possible monorepos and keeping the cache sharable (no absolute paths).
*/
export declare const resolveRelativeEntryPoint: typeof resolveEntryPoint;

189
node_modules/@expo/config/build/paths/paths.js generated vendored Normal file
View File

@@ -0,0 +1,189 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.convertEntryPointToRelative = convertEntryPointToRelative;
exports.ensureSlash = ensureSlash;
exports.getFileWithExtensions = getFileWithExtensions;
exports.getMetroServerRoot = getMetroServerRoot;
exports.getMetroWorkspaceGlobs = getMetroWorkspaceGlobs;
exports.getPossibleProjectRoot = getPossibleProjectRoot;
exports.resolveEntryPoint = resolveEntryPoint;
exports.resolveRelativeEntryPoint = void 0;
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _resolveFrom() {
const data = _interopRequireDefault(require("resolve-from"));
_resolveFrom = function () {
return data;
};
return data;
}
function _resolveWorkspaceRoot() {
const data = require("resolve-workspace-root");
_resolveWorkspaceRoot = function () {
return data;
};
return data;
}
function _env() {
const data = require("./env");
_env = function () {
return data;
};
return data;
}
function _extensions() {
const data = require("./extensions");
_extensions = function () {
return data;
};
return data;
}
function _Config() {
const data = require("../Config");
_Config = function () {
return data;
};
return data;
}
function _Errors() {
const data = require("../Errors");
_Errors = function () {
return data;
};
return data;
}
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
// https://github.com/facebook/create-react-app/blob/9750738cce89a967cc71f28390daf5d4311b193c/packages/react-scripts/config/paths.js#L22
function ensureSlash(inputPath, needsSlash) {
const hasSlash = inputPath.endsWith('/');
if (hasSlash && !needsSlash) {
return inputPath.substring(0, inputPath.length - 1);
} else if (!hasSlash && needsSlash) {
return `${inputPath}/`;
} else {
return inputPath;
}
}
function getPossibleProjectRoot() {
return _fs().default.realpathSync(process.cwd());
}
const nativePlatforms = ['ios', 'android'];
/** @returns the absolute entry file for an Expo project. */
function resolveEntryPoint(projectRoot, {
platform,
pkg = (0, _Config().getPackageJson)(projectRoot)
} = {}) {
const platforms = !platform ? [] : nativePlatforms.includes(platform) ? [platform, 'native'] : [platform];
const extensions = (0, _extensions().getBareExtensions)(platforms);
// If the config doesn't define a custom entry then we want to look at the `package.json`s `main` field, and try again.
const {
main
} = pkg;
if (main && typeof main === 'string') {
// Testing the main field against all of the provided extensions - for legacy reasons we can't use node module resolution as the package.json allows you to pass in a file without a relative path and expect it as a relative path.
let entry = getFileWithExtensions(projectRoot, main, extensions);
if (!entry) {
// Allow for paths like: `{ "main": "expo/AppEntry" }`
entry = resolveFromSilentWithExtensions(projectRoot, main, extensions);
if (!entry) throw new (_Errors().ConfigError)(`Cannot resolve entry file: The \`main\` field defined in your \`package.json\` points to an unresolvable or non-existent path.`, 'ENTRY_NOT_FOUND');
}
return entry;
}
// Check for a root index.* file in the project root.
const entry = resolveFromSilentWithExtensions(projectRoot, './index', extensions);
if (entry) {
return entry;
}
try {
// If none of the default files exist then we will attempt to use the main Expo entry point.
// This requires `expo` to be installed in the project to work as it will use `node_module/expo/AppEntry.js`
// Doing this enables us to create a bare minimum Expo project.
// TODO(Bacon): We may want to do a check against `./App` and `expo` in the `package.json` `dependencies` as we can more accurately ensure that the project is expo-min without needing the modules installed.
return (0, _resolveFrom().default)(projectRoot, 'expo/AppEntry');
} catch {
throw new (_Errors().ConfigError)(`The project entry file could not be resolved. Define it in the \`main\` field of the \`package.json\`, create an \`index.js\`, or install the \`expo\` package.`, 'ENTRY_NOT_FOUND');
}
}
// Resolve from but with the ability to resolve like a bundler
function resolveFromSilentWithExtensions(fromDirectory, moduleId, extensions) {
for (const extension of extensions) {
const modulePath = _resolveFrom().default.silent(fromDirectory, `${moduleId}.${extension}`);
if (modulePath?.endsWith(extension)) {
return modulePath;
}
}
return _resolveFrom().default.silent(fromDirectory, moduleId) || null;
}
// Statically attempt to resolve a module but with the ability to resolve like a bundler.
// This won't use node module resolution.
function getFileWithExtensions(fromDirectory, moduleId, extensions) {
const modulePath = _path().default.join(fromDirectory, moduleId);
if (_fs().default.existsSync(modulePath)) {
return modulePath;
}
for (const extension of extensions) {
const modulePath = _path().default.join(fromDirectory, `${moduleId}.${extension}`);
if (_fs().default.existsSync(modulePath)) {
return modulePath;
}
}
return null;
}
/** Get the Metro server root, when working in monorepos */
function getMetroServerRoot(projectRoot) {
if (_env().env.EXPO_NO_METRO_WORKSPACE_ROOT) {
return projectRoot;
}
return (0, _resolveWorkspaceRoot().resolveWorkspaceRoot)(projectRoot) ?? projectRoot;
}
/**
* Get the workspace globs for Metro's watchFolders.
* @note This does not traverse the monorepo, and should be used with `getMetroServerRoot`
*/
function getMetroWorkspaceGlobs(monorepoRoot) {
return (0, _resolveWorkspaceRoot().getWorkspaceGlobs)(monorepoRoot);
}
/**
* Convert an absolute entry point to a server or project root relative filepath.
* This is useful on Android where the entry point is an absolute path.
*/
function convertEntryPointToRelative(projectRoot, absolutePath) {
// The project root could be using a different root on MacOS (`/var` vs `/private/var`)
// We need to make sure to get the non-symlinked path to the server or project root.
return _path().default.relative(_fs().default.realpathSync(getMetroServerRoot(projectRoot)), _fs().default.realpathSync(absolutePath));
}
/**
* Resolve the entry point relative to either the server or project root.
* This relative entry path should be used to pass non-absolute paths to Metro,
* accounting for possible monorepos and keeping the cache sharable (no absolute paths).
*/
const resolveRelativeEntryPoint = (projectRoot, options) => {
return convertEntryPointToRelative(projectRoot, resolveEntryPoint(projectRoot, options));
};
exports.resolveRelativeEntryPoint = resolveRelativeEntryPoint;
//# sourceMappingURL=paths.js.map

1
node_modules/@expo/config/build/paths/paths.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
import { ConfigPlugin } from '@expo/config-plugins';
/**
* Resolves static plugins array as config plugin functions.
*
* @param config
* @param projectRoot
*/
export declare const withConfigPlugins: ConfigPlugin<boolean>;

View File

@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.withConfigPlugins = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _Serialize() {
const data = require("../Serialize");
_Serialize = function () {
return data;
};
return data;
}
/**
* Resolves static plugins array as config plugin functions.
*
* @param config
* @param projectRoot
*/
const withConfigPlugins = (config, skipPlugins) => {
// @ts-ignore: plugins not on config type yet -- TODO
if (!Array.isArray(config.plugins) || !config.plugins?.length) {
return config;
}
if (!skipPlugins) {
// Resolve and evaluate plugins
// @ts-ignore: TODO: add plugins to the config schema
config = (0, _configPlugins().withPlugins)(config, config.plugins);
} else {
// Delete the plugins array in case someone added functions or other values which cannot be automatically serialized.
delete config.plugins;
}
// plugins aren't serialized by default, serialize the plugins after resolving them.
return (0, _Serialize().serializeAfterStaticPlugins)(config);
};
exports.withConfigPlugins = withConfigPlugins;
//# sourceMappingURL=withConfigPlugins.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withConfigPlugins.js","names":["_configPlugins","data","require","_Serialize","withConfigPlugins","config","skipPlugins","Array","isArray","plugins","length","withPlugins","serializeAfterStaticPlugins","exports"],"sources":["../../src/plugins/withConfigPlugins.ts"],"sourcesContent":["import { ConfigPlugin, withPlugins } from '@expo/config-plugins';\n\nimport { serializeAfterStaticPlugins } from '../Serialize';\n\n/**\n * Resolves static plugins array as config plugin functions.\n *\n * @param config\n * @param projectRoot\n */\nexport const withConfigPlugins: ConfigPlugin<boolean> = (config, skipPlugins) => {\n // @ts-ignore: plugins not on config type yet -- TODO\n if (!Array.isArray(config.plugins) || !config.plugins?.length) {\n return config;\n }\n if (!skipPlugins) {\n // Resolve and evaluate plugins\n // @ts-ignore: TODO: add plugins to the config schema\n config = withPlugins(config, config.plugins);\n } else {\n // Delete the plugins array in case someone added functions or other values which cannot be automatically serialized.\n delete config.plugins;\n }\n // plugins aren't serialized by default, serialize the plugins after resolving them.\n return serializeAfterStaticPlugins(config);\n};\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,iBAAwC,GAAGA,CAACC,MAAM,EAAEC,WAAW,KAAK;EAC/E;EACA,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,MAAM,CAACI,OAAO,CAAC,IAAI,CAACJ,MAAM,CAACI,OAAO,EAAEC,MAAM,EAAE;IAC7D,OAAOL,MAAM;EACf;EACA,IAAI,CAACC,WAAW,EAAE;IAChB;IACA;IACAD,MAAM,GAAG,IAAAM,4BAAW,EAACN,MAAM,EAAEA,MAAM,CAACI,OAAO,CAAC;EAC9C,CAAC,MAAM;IACL;IACA,OAAOJ,MAAM,CAACI,OAAO;EACvB;EACA;EACA,OAAO,IAAAG,wCAA2B,EAACP,MAAM,CAAC;AAC5C,CAAC;AAACQ,OAAA,CAAAT,iBAAA,GAAAA,iBAAA","ignoreList":[]}

View File

@@ -0,0 +1,13 @@
import { ConfigPlugin } from '@expo/config-plugins';
import { ConfigFilePaths } from '../Config.types';
export declare const EXPO_DEBUG: boolean;
/**
* Adds the _internal object.
*
* @param config
* @param projectRoot
*/
export declare const withInternal: ConfigPlugin<{
projectRoot: string;
packageJsonPath?: string;
} & Partial<ConfigFilePaths>>;

View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.withInternal = exports.EXPO_DEBUG = void 0;
function _getenv() {
const data = require("getenv");
_getenv = function () {
return data;
};
return data;
}
const EXPO_DEBUG = exports.EXPO_DEBUG = (0, _getenv().boolish)('EXPO_DEBUG', false);
/**
* Adds the _internal object.
*
* @param config
* @param projectRoot
*/
const withInternal = (config, internals) => {
if (!config._internal) {
config._internal = {};
}
config._internal = {
isDebug: EXPO_DEBUG,
...config._internal,
...internals
};
return config;
};
exports.withInternal = withInternal;
//# sourceMappingURL=withInternal.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"withInternal.js","names":["_getenv","data","require","EXPO_DEBUG","exports","boolish","withInternal","config","internals","_internal","isDebug"],"sources":["../../src/plugins/withInternal.ts"],"sourcesContent":["import { ConfigPlugin } from '@expo/config-plugins';\nimport { boolish } from 'getenv';\n\nimport { ConfigFilePaths } from '../Config.types';\n\nexport const EXPO_DEBUG = boolish('EXPO_DEBUG', false);\n\n/**\n * Adds the _internal object.\n *\n * @param config\n * @param projectRoot\n */\nexport const withInternal: ConfigPlugin<\n { projectRoot: string; packageJsonPath?: string } & Partial<ConfigFilePaths>\n> = (config, internals) => {\n if (!config._internal) {\n config._internal = {};\n }\n\n config._internal = {\n isDebug: EXPO_DEBUG,\n ...config._internal,\n ...internals,\n };\n\n return config;\n};\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,MAAME,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,IAAAE,iBAAO,EAAC,YAAY,EAAE,KAAK,CAAC;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAEZ,GAAGA,CAACC,MAAM,EAAEC,SAAS,KAAK;EACzB,IAAI,CAACD,MAAM,CAACE,SAAS,EAAE;IACrBF,MAAM,CAACE,SAAS,GAAG,CAAC,CAAC;EACvB;EAEAF,MAAM,CAACE,SAAS,GAAG;IACjBC,OAAO,EAAEP,UAAU;IACnB,GAAGI,MAAM,CAACE,SAAS;IACnB,GAAGD;EACL,CAAC;EAED,OAAOD,MAAM;AACf,CAAC;AAACH,OAAA,CAAAE,YAAA,GAAAA,YAAA","ignoreList":[]}

View File

@@ -0,0 +1 @@
export declare function getRootPackageJsonPath(projectRoot: string): string;

35
node_modules/@expo/config/build/resolvePackageJson.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getRootPackageJsonPath = getRootPackageJsonPath;
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
function _Errors() {
const data = require("./Errors");
_Errors = function () {
return data;
};
return data;
}
function getRootPackageJsonPath(projectRoot) {
const packageJsonPath = (0, _path().join)(projectRoot, 'package.json');
if (!(0, _fs().existsSync)(packageJsonPath)) {
throw new (_Errors().ConfigError)(`The expected package.json path: ${packageJsonPath} does not exist`, 'MODULE_NOT_FOUND');
}
return packageJsonPath;
}
//# sourceMappingURL=resolvePackageJson.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"resolvePackageJson.js","names":["_fs","data","require","_path","_Errors","getRootPackageJsonPath","projectRoot","packageJsonPath","join","existsSync","ConfigError"],"sources":["../src/resolvePackageJson.ts"],"sourcesContent":["import { existsSync } from 'fs';\nimport { join } from 'path';\n\nimport { ConfigError } from './Errors';\n\nexport function getRootPackageJsonPath(projectRoot: string): string {\n const packageJsonPath = join(projectRoot, 'package.json');\n if (!existsSync(packageJsonPath)) {\n throw new ConfigError(\n `The expected package.json path: ${packageJsonPath} does not exist`,\n 'MODULE_NOT_FOUND'\n );\n }\n return packageJsonPath;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,SAASI,sBAAsBA,CAACC,WAAmB,EAAU;EAClE,MAAMC,eAAe,GAAG,IAAAC,YAAI,EAACF,WAAW,EAAE,cAAc,CAAC;EACzD,IAAI,CAAC,IAAAG,gBAAU,EAACF,eAAe,CAAC,EAAE;IAChC,MAAM,KAAIG,qBAAW,EACnB,mCAAmCH,eAAe,iBAAiB,EACnE,kBACF,CAAC;EACH;EACA,OAAOA,eAAe;AACxB","ignoreList":[]}

View File

@@ -0,0 +1,23 @@
(MIT)
Original code Copyright Julian Gruber <julian@juliangruber.com>
Port to TypeScript Copyright Isaac Z. Schlueter <i@izs.me>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,57 @@
# balanced-match
Match balanced string pairs, like `{` and `}` or `<b>` and
`</b>`. Supports regular expressions as well!
## Example
Get the first matching pair of braces:
```js
import { balanced } from 'balanced-match'
console.log(balanced('{', '}', 'pre{in{nested}}post'))
console.log(balanced('{', '}', 'pre{first}between{second}post'))
console.log(
balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'),
)
```
The matches are:
```bash
$ node example.js
{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
{ start: 3,
end: 9,
pre: 'pre',
body: 'first',
post: 'between{second}post' }
{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
```
## API
### const m = balanced(a, b, str)
For the first non-nested matching pair of `a` and `b` in `str`, return an
object with those keys:
- **start** the index of the first match of `a`
- **end** the index of the matching `b`
- **pre** the preamble, `a` and `b` not included
- **body** the match, `a` and `b` not included
- **post** the postscript, `a` and `b` not included
If there's no match, `undefined` will be returned.
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
### const r = balanced.range(a, b, str)
For the first non-nested matching pair of `a` and `b` in `str`, return an
array with indexes: `[ <a index>, <b index> ]`.
If there's no match, `undefined` will be returned.
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.

View File

@@ -0,0 +1,9 @@
export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | {
start: number;
end: number;
pre: string;
body: string;
post: string;
} | undefined;
export declare const range: (a: string, b: string, str: string) => undefined | [number, number];
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"}

View File

@@ -0,0 +1,59 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.range = exports.balanced = void 0;
const balanced = (a, b, str) => {
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
const r = ma !== null && mb != null && (0, exports.range)(ma, mb, str);
return (r && {
start: r[0],
end: r[1],
pre: str.slice(0, r[0]),
body: str.slice(r[0] + ma.length, r[1]),
post: str.slice(r[1] + mb.length),
});
};
exports.balanced = balanced;
const maybeMatch = (reg, str) => {
const m = str.match(reg);
return m ? m[0] : null;
};
const range = (a, b, str) => {
let begs, beg, left, right = undefined, result;
let ai = str.indexOf(a);
let bi = str.indexOf(b, ai + 1);
let i = ai;
if (ai >= 0 && bi > 0) {
if (a === b) {
return [ai, bi];
}
begs = [];
left = str.length;
while (i >= 0 && !result) {
if (i === ai) {
begs.push(i);
ai = str.indexOf(a, i + 1);
}
else if (begs.length === 1) {
const r = begs.pop();
if (r !== undefined)
result = [r, bi];
}
else {
beg = begs.pop();
if (beg !== undefined && beg < left) {
left = beg;
right = bi;
}
bi = str.indexOf(b, i + 1);
}
i = ai < bi && ai >= 0 ? ai : bi;
}
if (begs.length && right !== undefined) {
result = [left, right];
}
}
return result;
};
exports.range = range;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,IAAA,aAAK,EAAC,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: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]}

View File

@@ -0,0 +1,3 @@
{
"type": "commonjs"
}

View File

@@ -0,0 +1,9 @@
export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | {
start: number;
end: number;
pre: string;
body: string;
post: string;
} | undefined;
export declare const range: (a: string, b: string, str: string) => undefined | [number, number];
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"}

View File

@@ -0,0 +1,54 @@
export const balanced = (a, b, str) => {
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
const r = ma !== null && mb != null && range(ma, mb, str);
return (r && {
start: r[0],
end: r[1],
pre: str.slice(0, r[0]),
body: str.slice(r[0] + ma.length, r[1]),
post: str.slice(r[1] + mb.length),
});
};
const maybeMatch = (reg, str) => {
const m = str.match(reg);
return m ? m[0] : null;
};
export const range = (a, b, str) => {
let begs, beg, left, right = undefined, result;
let ai = str.indexOf(a);
let bi = str.indexOf(b, ai + 1);
let i = ai;
if (ai >= 0 && bi > 0) {
if (a === b) {
return [ai, bi];
}
begs = [];
left = str.length;
while (i >= 0 && !result) {
if (i === ai) {
begs.push(i);
ai = str.indexOf(a, i + 1);
}
else if (begs.length === 1) {
const r = begs.pop();
if (r !== undefined)
result = [r, bi];
}
else {
beg = begs.pop();
if (beg !== undefined && beg < left) {
left = beg;
right = bi;
}
bi = str.indexOf(b, i + 1);
}
i = ai < bi && ai >= 0 ? ai : bi;
}
if (begs.length && right !== undefined) {
result = [left, right];
}
}
return result;
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAA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CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]}

View File

@@ -0,0 +1,3 @@
{
"type": "module"
}

View File

@@ -0,0 +1,68 @@
{
"name": "balanced-match",
"description": "Match balanced character pairs, like \"{\" and \"}\"",
"version": "4.0.4",
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git://github.com/juliangruber/balanced-match.git"
},
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"type": "module",
"scripts": {
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"prepare": "tshy",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"test": "tap",
"snap": "tap",
"format": "prettier --write .",
"benchmark": "node benchmark/index.js",
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
},
"devDependencies": {
"@types/brace-expansion": "^1.1.2",
"@types/node": "^25.2.1",
"mkdirp": "^3.0.1",
"prettier": "^3.3.2",
"tap": "^21.6.2",
"tshy": "^3.0.2",
"typedoc": "^0.28.5"
},
"keywords": [
"match",
"regexp",
"test",
"balanced",
"parse"
],
"license": "MIT",
"engines": {
"node": "18 || 20 || >=22"
},
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"module": "./dist/esm/index.js"
}

View File

@@ -0,0 +1,23 @@
MIT License
Copyright Julian Gruber <julian@juliangruber.com>
TypeScript port Copyright Isaac Z. Schlueter <i@izs.me>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,94 @@
# brace-expansion
[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
as known from sh/bash, in JavaScript.
[![CI](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml)
[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion)
## Example
```js
import { expand } from 'brace-expansion'
expand('file-{a,b,c}.jpg')
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
expand('-v{,,}')
// => ['-v', '-v', '-v']
expand('file{0..2}.jpg')
// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
expand('file-{a..c}.jpg')
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
expand('file{2..0}.jpg')
// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
expand('file{0..4..2}.jpg')
// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
expand('file-{a..e..2}.jpg')
// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
expand('file{00..10..5}.jpg')
// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
expand('{{A..C},{a..c}}')
// => ['A', 'B', 'C', 'a', 'b', 'c']
expand('ppp{,config,oe{,conf}}')
// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
```
## API
```js
import { expand } from 'brace-expansion'
```
### const expanded = expand(str, [options])
Return an array of all possible and valid expansions of `str`. If
none are found, `[str]` is returned.
The `options` object can provide a `max` value to cap the number
of expansions allowed. This is limited to `100_000` by default,
to prevent DoS attacks.
```js
const expansions = expand('{1..100}'.repeat(5), {
max: 100,
})
// expansions.length will be 100, not 100^5
```
Valid expansions are:
```js
;/^(.*,)+(.+)?$/
// {a,b,...}
```
A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
```js
;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
// {x..y[..incr]}
```
A numeric sequence from `x` to `y` inclusive, with optional increment.
If `x` or `y` start with a leading `0`, all the numbers will be padded
to have equal length. Negative numbers and backwards iteration work too.
```js
;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
// {x..y[..incr]}
```
An alphabetic sequence from `x` to `y` inclusive, with optional increment.
`x` and `y` must be exactly one character, and if given, `incr` must be a
number.
For compatibility reasons, the string `${` is not eligible for brace expansion.

View File

@@ -0,0 +1,6 @@
export declare const EXPANSION_MAX = 100000;
export type BraceExpansionOptions = {
max?: number;
};
export declare function expand(str: string, options?: BraceExpansionOptions): string[];
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAwDpC,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"}

View File

@@ -0,0 +1,199 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EXPANSION_MAX = void 0;
exports.expand = expand;
const balanced_match_1 = require("balanced-match");
const escSlash = '\0SLASH' + Math.random() + '\0';
const escOpen = '\0OPEN' + Math.random() + '\0';
const escClose = '\0CLOSE' + Math.random() + '\0';
const escComma = '\0COMMA' + Math.random() + '\0';
const escPeriod = '\0PERIOD' + Math.random() + '\0';
const escSlashPattern = new RegExp(escSlash, 'g');
const escOpenPattern = new RegExp(escOpen, 'g');
const escClosePattern = new RegExp(escClose, 'g');
const escCommaPattern = new RegExp(escComma, 'g');
const escPeriodPattern = new RegExp(escPeriod, 'g');
const slashPattern = /\\\\/g;
const openPattern = /\\{/g;
const closePattern = /\\}/g;
const commaPattern = /\\,/g;
const periodPattern = /\\\./g;
exports.EXPANSION_MAX = 100_000;
function numeric(str) {
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
}
function escapeBraces(str) {
return str
.replace(slashPattern, escSlash)
.replace(openPattern, escOpen)
.replace(closePattern, escClose)
.replace(commaPattern, escComma)
.replace(periodPattern, escPeriod);
}
function unescapeBraces(str) {
return str
.replace(escSlashPattern, '\\')
.replace(escOpenPattern, '{')
.replace(escClosePattern, '}')
.replace(escCommaPattern, ',')
.replace(escPeriodPattern, '.');
}
/**
* Basically just str.split(","), but handling cases
* where we have nested braced sections, which should be
* treated as individual members, like {a,{b,c},d}
*/
function parseCommaParts(str) {
if (!str) {
return [''];
}
const parts = [];
const m = (0, balanced_match_1.balanced)('{', '}', str);
if (!m) {
return str.split(',');
}
const { pre, body, post } = m;
const p = pre.split(',');
p[p.length - 1] += '{' + body + '}';
const postParts = parseCommaParts(post);
if (post.length) {
;
p[p.length - 1] += postParts.shift();
p.push.apply(p, postParts);
}
parts.push.apply(parts, p);
return parts;
}
function expand(str, options = {}) {
if (!str) {
return [];
}
const { max = exports.EXPANSION_MAX } = options;
// I don't know why Bash 4.3 does this, but it does.
// Anything starting with {} will have the first two bytes preserved
// but *only* at the top level, so {},a}b will not expand to anything,
// but a{},b}c will be expanded to [a}c,abc].
// One could argue that this is a bug in Bash, but since the goal of
// this module is to match Bash's rules, we escape a leading {}
if (str.slice(0, 2) === '{}') {
str = '\\{\\}' + str.slice(2);
}
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
}
function embrace(str) {
return '{' + str + '}';
}
function isPadded(el) {
return /^-?0\d/.test(el);
}
function lte(i, y) {
return i <= y;
}
function gte(i, y) {
return i >= y;
}
function expand_(str, max, isTop) {
/** @type {string[]} */
const expansions = [];
const m = (0, balanced_match_1.balanced)('{', '}', str);
if (!m)
return [str];
// no need to expand pre, since it is guaranteed to be free of brace-sets
const pre = m.pre;
const post = m.post.length ? expand_(m.post, max, false) : [''];
if (/\$$/.test(m.pre)) {
for (let k = 0; k < post.length && k < max; k++) {
const expansion = pre + '{' + m.body + '}' + post[k];
expansions.push(expansion);
}
}
else {
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
const isSequence = isNumericSequence || isAlphaSequence;
const isOptions = m.body.indexOf(',') >= 0;
if (!isSequence && !isOptions) {
// {a},b}
if (m.post.match(/,(?!,).*\}/)) {
str = m.pre + '{' + m.body + escClose + m.post;
return expand_(str, max, true);
}
return [str];
}
let n;
if (isSequence) {
n = m.body.split(/\.\./);
}
else {
n = parseCommaParts(m.body);
if (n.length === 1 && n[0] !== undefined) {
// x{{a,b}}y ==> x{a}y x{b}y
n = expand_(n[0], max, false).map(embrace);
//XXX is this necessary? Can't seem to hit it in tests.
/* c8 ignore start */
if (n.length === 1) {
return post.map(p => m.pre + n[0] + p);
}
/* c8 ignore stop */
}
}
// at this point, n is the parts, and we know it's not a comma set
// with a single entry.
let N;
if (isSequence && n[0] !== undefined && n[1] !== undefined) {
const x = numeric(n[0]);
const y = numeric(n[1]);
const width = Math.max(n[0].length, n[1].length);
let incr = n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1;
let test = lte;
const reverse = y < x;
if (reverse) {
incr *= -1;
test = gte;
}
const pad = n.some(isPadded);
N = [];
for (let i = x; test(i, y); i += incr) {
let c;
if (isAlphaSequence) {
c = String.fromCharCode(i);
if (c === '\\') {
c = '';
}
}
else {
c = String(i);
if (pad) {
const need = width - c.length;
if (need > 0) {
const z = new Array(need + 1).join('0');
if (i < 0) {
c = '-' + z + c.slice(1);
}
else {
c = z + c;
}
}
}
}
N.push(c);
}
}
else {
N = [];
for (let j = 0; j < n.length; j++) {
N.push.apply(N, expand_(n[j], max, false));
}
}
for (let j = 0; j < N.length; j++) {
for (let k = 0; k < post.length && expansions.length < max; k++) {
const expansion = pre + N[j] + post[k];
if (!isTop || isSequence || expansion) {
expansions.push(expansion);
}
}
}
}
return expansions;
}
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
{
"type": "commonjs"
}

View File

@@ -0,0 +1,6 @@
export declare const EXPANSION_MAX = 100000;
export type BraceExpansionOptions = {
max?: number;
};
export declare function expand(str: string, options?: BraceExpansionOptions): string[];
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAwDpC,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"}

View File

@@ -0,0 +1,195 @@
import { balanced } from 'balanced-match';
const escSlash = '\0SLASH' + Math.random() + '\0';
const escOpen = '\0OPEN' + Math.random() + '\0';
const escClose = '\0CLOSE' + Math.random() + '\0';
const escComma = '\0COMMA' + Math.random() + '\0';
const escPeriod = '\0PERIOD' + Math.random() + '\0';
const escSlashPattern = new RegExp(escSlash, 'g');
const escOpenPattern = new RegExp(escOpen, 'g');
const escClosePattern = new RegExp(escClose, 'g');
const escCommaPattern = new RegExp(escComma, 'g');
const escPeriodPattern = new RegExp(escPeriod, 'g');
const slashPattern = /\\\\/g;
const openPattern = /\\{/g;
const closePattern = /\\}/g;
const commaPattern = /\\,/g;
const periodPattern = /\\\./g;
export const EXPANSION_MAX = 100_000;
function numeric(str) {
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
}
function escapeBraces(str) {
return str
.replace(slashPattern, escSlash)
.replace(openPattern, escOpen)
.replace(closePattern, escClose)
.replace(commaPattern, escComma)
.replace(periodPattern, escPeriod);
}
function unescapeBraces(str) {
return str
.replace(escSlashPattern, '\\')
.replace(escOpenPattern, '{')
.replace(escClosePattern, '}')
.replace(escCommaPattern, ',')
.replace(escPeriodPattern, '.');
}
/**
* Basically just str.split(","), but handling cases
* where we have nested braced sections, which should be
* treated as individual members, like {a,{b,c},d}
*/
function parseCommaParts(str) {
if (!str) {
return [''];
}
const parts = [];
const m = balanced('{', '}', str);
if (!m) {
return str.split(',');
}
const { pre, body, post } = m;
const p = pre.split(',');
p[p.length - 1] += '{' + body + '}';
const postParts = parseCommaParts(post);
if (post.length) {
;
p[p.length - 1] += postParts.shift();
p.push.apply(p, postParts);
}
parts.push.apply(parts, p);
return parts;
}
export function expand(str, options = {}) {
if (!str) {
return [];
}
const { max = EXPANSION_MAX } = options;
// I don't know why Bash 4.3 does this, but it does.
// Anything starting with {} will have the first two bytes preserved
// but *only* at the top level, so {},a}b will not expand to anything,
// but a{},b}c will be expanded to [a}c,abc].
// One could argue that this is a bug in Bash, but since the goal of
// this module is to match Bash's rules, we escape a leading {}
if (str.slice(0, 2) === '{}') {
str = '\\{\\}' + str.slice(2);
}
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
}
function embrace(str) {
return '{' + str + '}';
}
function isPadded(el) {
return /^-?0\d/.test(el);
}
function lte(i, y) {
return i <= y;
}
function gte(i, y) {
return i >= y;
}
function expand_(str, max, isTop) {
/** @type {string[]} */
const expansions = [];
const m = balanced('{', '}', str);
if (!m)
return [str];
// no need to expand pre, since it is guaranteed to be free of brace-sets
const pre = m.pre;
const post = m.post.length ? expand_(m.post, max, false) : [''];
if (/\$$/.test(m.pre)) {
for (let k = 0; k < post.length && k < max; k++) {
const expansion = pre + '{' + m.body + '}' + post[k];
expansions.push(expansion);
}
}
else {
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
const isSequence = isNumericSequence || isAlphaSequence;
const isOptions = m.body.indexOf(',') >= 0;
if (!isSequence && !isOptions) {
// {a},b}
if (m.post.match(/,(?!,).*\}/)) {
str = m.pre + '{' + m.body + escClose + m.post;
return expand_(str, max, true);
}
return [str];
}
let n;
if (isSequence) {
n = m.body.split(/\.\./);
}
else {
n = parseCommaParts(m.body);
if (n.length === 1 && n[0] !== undefined) {
// x{{a,b}}y ==> x{a}y x{b}y
n = expand_(n[0], max, false).map(embrace);
//XXX is this necessary? Can't seem to hit it in tests.
/* c8 ignore start */
if (n.length === 1) {
return post.map(p => m.pre + n[0] + p);
}
/* c8 ignore stop */
}
}
// at this point, n is the parts, and we know it's not a comma set
// with a single entry.
let N;
if (isSequence && n[0] !== undefined && n[1] !== undefined) {
const x = numeric(n[0]);
const y = numeric(n[1]);
const width = Math.max(n[0].length, n[1].length);
let incr = n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1;
let test = lte;
const reverse = y < x;
if (reverse) {
incr *= -1;
test = gte;
}
const pad = n.some(isPadded);
N = [];
for (let i = x; test(i, y); i += incr) {
let c;
if (isAlphaSequence) {
c = String.fromCharCode(i);
if (c === '\\') {
c = '';
}
}
else {
c = String(i);
if (pad) {
const need = width - c.length;
if (need > 0) {
const z = new Array(need + 1).join('0');
if (i < 0) {
c = '-' + z + c.slice(1);
}
else {
c = z + c;
}
}
}
}
N.push(c);
}
}
else {
N = [];
for (let j = 0; j < n.length; j++) {
N.push.apply(N, expand_(n[j], max, false));
}
}
for (let j = 0; j < N.length; j++) {
for (let k = 0; k < post.length && expansions.length < max; k++) {
const expansion = pre + N[j] + post[k];
if (!isTop || isSequence || expansion) {
expansions.push(expansion);
}
}
}
}
return expansions;
}
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
{
"type": "module"
}

View File

@@ -0,0 +1,64 @@
{
"name": "brace-expansion",
"description": "Brace expansion as known from sh/bash",
"version": "5.0.4",
"files": [
"dist"
],
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"type": "module",
"scripts": {
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"prepare": "tshy",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"test": "tap",
"snap": "tap",
"format": "prettier --write .",
"benchmark": "node benchmark/index.js",
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
},
"devDependencies": {
"@types/brace-expansion": "^1.1.2",
"@types/node": "^25.2.1",
"mkdirp": "^3.0.1",
"prettier": "^3.3.2",
"tap": "^21.6.2",
"tshy": "^3.0.2",
"typedoc": "^0.28.5"
},
"dependencies": {
"balanced-match": "^4.0.2"
},
"license": "MIT",
"engines": {
"node": "18 || 20 || >=22"
},
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"module": "./dist/esm/index.js",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/juliangruber/brace-expansion.git"
}
}

63
node_modules/@expo/config/node_modules/glob/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,63 @@
All packages under `src/` are licensed according to the terms in
their respective `LICENSE` or `LICENSE.md` files.
The remainder of this project is licensed under the Blue Oak
Model License, as follows:
-----
# Blue Oak Model License
Version 1.0.0
## Purpose
This license gives everyone as much permission to work with
this software as possible, while protecting contributors
from liability.
## Acceptance
In order to receive this license, you must agree to its
rules. The rules of this license are both obligations
under that agreement and conditions to your license.
You must not do anything with this software that triggers
a rule that you cannot or will not follow.
## Copyright
Each contributor licenses you to do everything with this
software that would otherwise infringe that contributor's
copyright in it.
## Notices
You must ensure that everyone who gets a copy of
any part of this software from you, with or without
changes, also gets the text of this license or a link to
<https://blueoakcouncil.org/license/1.0.0>.
## Excuse
If anyone notifies you in writing that you have not
complied with [Notices](#notices), you can keep your
license by taking all practical steps to comply within 30
days after the notice. If you do not do so, your license
ends immediately.
## Patent
Each contributor licenses you to do everything with this
software that would otherwise infringe any patent claims
they can license or become able to license.
## Reliability
No contributor can revoke this license.
## No Liability
***As far as the law allows, this software comes as is,
without any warranty or condition, and no contributor
will be liable to anyone for any damages related to this
software or this license, under any kind of legal claim.***

1203
node_modules/@expo/config/node_modules/glob/README.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,396 @@
import { Minimatch } from 'minimatch';
import { Minipass } from 'minipass';
import { FSOption, Path, PathScurry } from 'path-scurry';
import { IgnoreLike } from './ignore.js';
import { Pattern } from './pattern.js';
export type MatchSet = Minimatch['set'];
export type GlobParts = Exclude<Minimatch['globParts'], undefined>;
/**
* A `GlobOptions` object may be provided to any of the exported methods, and
* must be provided to the `Glob` constructor.
*
* All options are optional, boolean, and false by default, unless otherwise
* noted.
*
* All resolved options are added to the Glob object as properties.
*
* If you are running many `glob` operations, you can pass a Glob object as the
* `options` argument to a subsequent operation to share the previously loaded
* cache.
*/
export interface GlobOptions {
/**
* Set to `true` to always receive absolute paths for
* matched files. Set to `false` to always return relative paths.
*
* When this option is not set, absolute paths are returned for patterns
* that are absolute, and otherwise paths are returned that are relative
* to the `cwd` setting.
*
* This does _not_ make an extra system call to get
* the realpath, it only does string path resolution.
*
* Conflicts with {@link withFileTypes}
*/
absolute?: boolean;
/**
* Set to false to enable {@link windowsPathsNoEscape}
*
* @deprecated
*/
allowWindowsEscape?: boolean;
/**
* The current working directory in which to search. Defaults to
* `process.cwd()`.
*
* May be eiher a string path or a `file://` URL object or string.
*/
cwd?: string | URL;
/**
* Include `.dot` files in normal matches and `globstar`
* matches. Note that an explicit dot in a portion of the pattern
* will always match dot files.
*/
dot?: boolean;
/**
* Prepend all relative path strings with `./` (or `.\` on Windows).
*
* Without this option, returned relative paths are "bare", so instead of
* returning `'./foo/bar'`, they are returned as `'foo/bar'`.
*
* Relative patterns starting with `'../'` are not prepended with `./`, even
* if this option is set.
*/
dotRelative?: boolean;
/**
* Follow symlinked directories when expanding `**`
* patterns. This can result in a lot of duplicate references in
* the presence of cyclic links, and make performance quite bad.
*
* By default, a `**` in a pattern will follow 1 symbolic link if
* it is not the first item in the pattern, or none if it is the
* first item in the pattern, following the same behavior as Bash.
*/
follow?: boolean;
/**
* string or string[], or an object with `ignored` and `childrenIgnored`
* methods.
*
* If a string or string[] is provided, then this is treated as a glob
* pattern or array of glob patterns to exclude from matches. To ignore all
* children within a directory, as well as the entry itself, append `'/**'`
* to the ignore pattern.
*
* **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of
* any other settings.
*
* If an object is provided that has `ignored(path)` and/or
* `childrenIgnored(path)` methods, then these methods will be called to
* determine whether any Path is a match or if its children should be
* traversed, respectively.
*/
ignore?: string | string[] | IgnoreLike;
/**
* Treat brace expansion like `{a,b}` as a "magic" pattern. Has no
* effect if {@link nobrace} is set.
*
* Only has effect on the {@link hasMagic} function.
*/
magicalBraces?: boolean;
/**
* Add a `/` character to directory matches. Note that this requires
* additional stat calls in some cases.
*/
mark?: boolean;
/**
* Perform a basename-only match if the pattern does not contain any slash
* characters. That is, `*.js` would be treated as equivalent to
* `**\/*.js`, matching all js files in all directories.
*/
matchBase?: boolean;
/**
* Limit the directory traversal to a given depth below the cwd.
* Note that this does NOT prevent traversal to sibling folders,
* root patterns, and so on. It only limits the maximum folder depth
* that the walk will descend, relative to the cwd.
*/
maxDepth?: number;
/**
* Do not expand `{a,b}` and `{1..3}` brace sets.
*/
nobrace?: boolean;
/**
* Perform a case-insensitive match. This defaults to `true` on macOS and
* Windows systems, and `false` on all others.
*
* **Note** `nocase` should only be explicitly set when it is
* known that the filesystem's case sensitivity differs from the
* platform default. If set `true` on case-sensitive file
* systems, or `false` on case-insensitive file systems, then the
* walk may return more or less results than expected.
*/
nocase?: boolean;
/**
* Do not match directories, only files. (Note: to match
* _only_ directories, put a `/` at the end of the pattern.)
*/
nodir?: boolean;
/**
* Do not match "extglob" patterns such as `+(a|b)`.
*/
noext?: boolean;
/**
* Do not match `**` against multiple filenames. (Ie, treat it as a normal
* `*` instead.)
*
* Conflicts with {@link matchBase}
*/
noglobstar?: boolean;
/**
* Defaults to value of `process.platform` if available, or `'linux'` if
* not. Setting `platform:'win32'` on non-Windows systems may cause strange
* behavior.
*/
platform?: NodeJS.Platform;
/**
* Set to true to call `fs.realpath` on all of the
* results. In the case of an entry that cannot be resolved, the
* entry is omitted. This incurs a slight performance penalty, of
* course, because of the added system calls.
*/
realpath?: boolean;
/**
*
* A string path resolved against the `cwd` option, which
* is used as the starting point for absolute patterns that start
* with `/`, (but not drive letters or UNC paths on Windows).
*
* Note that this _doesn't_ necessarily limit the walk to the
* `root` directory, and doesn't affect the cwd starting point for
* non-absolute patterns. A pattern containing `..` will still be
* able to traverse out of the root directory, if it is not an
* actual root directory on the filesystem, and any non-absolute
* patterns will be matched in the `cwd`. For example, the
* pattern `/../*` with `{root:'/some/path'}` will return all
* files in `/some`, not all files in `/some/path`. The pattern
* `*` with `{root:'/some/path'}` will return all the entries in
* the cwd, not the entries in `/some/path`.
*
* To start absolute and non-absolute patterns in the same
* path, you can use `{root:''}`. However, be aware that on
* Windows systems, a pattern like `x:/*` or `//host/share/*` will
* _always_ start in the `x:/` or `//host/share` directory,
* regardless of the `root` setting.
*/
root?: string;
/**
* A [PathScurry](http://npm.im/path-scurry) object used
* to traverse the file system. If the `nocase` option is set
* explicitly, then any provided `scurry` object must match this
* setting.
*/
scurry?: PathScurry;
/**
* Call `lstat()` on all entries, whether required or not to determine
* if it's a valid match. When used with {@link withFileTypes}, this means
* that matches will include data such as modified time, permissions, and
* so on. Note that this will incur a performance cost due to the added
* system calls.
*/
stat?: boolean;
/**
* An AbortSignal which will cancel the Glob walk when
* triggered.
*/
signal?: AbortSignal;
/**
* Use `\\` as a path separator _only_, and
* _never_ as an escape character. If set, all `\\` characters are
* replaced with `/` in the pattern.
*
* Note that this makes it **impossible** to match against paths
* containing literal glob pattern characters, but allows matching
* with patterns constructed using `path.join()` and
* `path.resolve()` on Windows platforms, mimicking the (buggy!)
* behavior of Glob v7 and before on Windows. Please use with
* caution, and be mindful of [the caveat below about Windows
* paths](#windows). (For legacy reasons, this is also set if
* `allowWindowsEscape` is set to the exact value `false`.)
*/
windowsPathsNoEscape?: boolean;
/**
* Return [PathScurry](http://npm.im/path-scurry)
* `Path` objects instead of strings. These are similar to a
* NodeJS `Dirent` object, but with additional methods and
* properties.
*
* Conflicts with {@link absolute}
*/
withFileTypes?: boolean;
/**
* An fs implementation to override some or all of the defaults. See
* http://npm.im/path-scurry for details about what can be overridden.
*/
fs?: FSOption;
/**
* Just passed along to Minimatch. Note that this makes all pattern
* matching operations slower and *extremely* noisy.
*/
debug?: boolean;
/**
* Return `/` delimited paths, even on Windows.
*
* On posix systems, this has no effect. But, on Windows, it means that
* paths will be `/` delimited, and absolute paths will be their full
* resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return
* `'//?/C:/foo/bar'`
*/
posix?: boolean;
/**
* Do not match any children of any matches. For example, the pattern
* `**\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.
*
* This is especially useful for cases like "find all `node_modules`
* folders, but not the ones in `node_modules`".
*
* In order to support this, the `Ignore` implementation must support an
* `add(pattern: string)` method. If using the default `Ignore` class, then
* this is fine, but if this is set to `false`, and a custom `Ignore` is
* provided that does not have an `add()` method, then it will throw an
* error.
*
* **Caveat** It *only* ignores matches that would be a descendant of a
* previous match, and only if that descendant is matched *after* the
* ancestor is encountered. Since the file system walk happens in
* indeterminate order, it's possible that a match will already be added
* before its ancestor, if multiple or braced patterns are used.
*
* For example:
*
* ```ts
* const results = await glob([
* // likely to match first, since it's just a stat
* 'a/b/c/d/e/f',
*
* // this pattern is more complicated! It must to various readdir()
* // calls and test the results against a regular expression, and that
* // is certainly going to take a little bit longer.
* //
* // So, later on, it encounters a match at 'a/b/c/d/e', but it's too
* // late to ignore a/b/c/d/e/f, because it's already been emitted.
* 'a/[bdf]/?/[a-z]/*',
* ], { includeChildMatches: false })
* ```
*
* It's best to only set this to `false` if you can be reasonably sure that
* no components of the pattern will potentially match one another's file
* system descendants, or if the occasional included child entry will not
* cause problems.
*
* @default true
*/
includeChildMatches?: boolean;
/**
* max number of `{...}` patterns to expand. Default `1_000`.
*
* Note: this is much less than minimatch's default of `100_000`,
* because Glob has higher memory requirements due to walking
* the file system tree.
*/
braceExpandMax?: number;
}
export type GlobOptionsWithFileTypesTrue = GlobOptions & {
withFileTypes: true;
absolute?: undefined;
mark?: undefined;
posix?: undefined;
};
export type GlobOptionsWithFileTypesFalse = GlobOptions & {
withFileTypes?: false;
};
export type GlobOptionsWithFileTypesUnset = GlobOptions & {
withFileTypes?: undefined;
};
export type Result<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? Path : Opts extends GlobOptionsWithFileTypesFalse ? string : Opts extends GlobOptionsWithFileTypesUnset ? string : string | Path;
export type Results<Opts> = Result<Opts>[];
export type FileTypes<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? true : Opts extends GlobOptionsWithFileTypesFalse ? false : Opts extends GlobOptionsWithFileTypesUnset ? false : boolean;
/**
* An object that can perform glob pattern traversals.
*/
export declare class Glob<Opts extends GlobOptions> implements GlobOptions {
absolute?: boolean;
cwd: string;
root?: string;
dot: boolean;
dotRelative: boolean;
follow: boolean;
ignore?: string | string[] | IgnoreLike;
magicalBraces: boolean;
mark?: boolean;
matchBase: boolean;
maxDepth: number;
nobrace: boolean;
nocase: boolean;
nodir: boolean;
noext: boolean;
noglobstar: boolean;
pattern: string[];
platform: NodeJS.Platform;
realpath: boolean;
scurry: PathScurry;
stat: boolean;
signal?: AbortSignal;
windowsPathsNoEscape: boolean;
withFileTypes: FileTypes<Opts>;
includeChildMatches: boolean;
/**
* The options provided to the constructor.
*/
opts: Opts;
/**
* An array of parsed immutable {@link Pattern} objects.
*/
patterns: Pattern[];
/**
* All options are stored as properties on the `Glob` object.
*
* See {@link GlobOptions} for full options descriptions.
*
* Note that a previous `Glob` object can be passed as the
* `GlobOptions` to another `Glob` instantiation to re-use settings
* and caches with a new pattern.
*
* Traversal functions can be called multiple times to run the walk
* again.
*/
constructor(pattern: string | string[], opts: Opts);
/**
* Returns a Promise that resolves to the results array.
*/
walk(): Promise<Results<Opts>>;
/**
* synchronous {@link Glob.walk}
*/
walkSync(): Results<Opts>;
/**
* Stream results asynchronously.
*/
stream(): Minipass<Result<Opts>, Result<Opts>>;
/**
* Stream results synchronously.
*/
streamSync(): Minipass<Result<Opts>, Result<Opts>>;
/**
* Default sync iteration function. Returns a Generator that
* iterates over the results.
*/
iterateSync(): Generator<Result<Opts>, void, void>;
[Symbol.iterator](): Generator<Result<Opts>, void, void>;
/**
* Default async iteration function. Returns an AsyncGenerator that
* iterates over the results.
*/
iterate(): AsyncGenerator<Result<Opts>, void, void>;
[Symbol.asyncIterator](): AsyncGenerator<Result<Opts>, void, void>;
}
//# sourceMappingURL=glob.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AACvC,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAA;AAalE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAE5B;;;;;OAKG;IACH,GAAG,C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CAAC;IAc9C;;OAEG;IACH,UAAU,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAclD;;;OAGG;IACH,WAAW,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGlD,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB;;;OAGG;IACH,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGnD,CAAC,MAAM,CAAC,aAAa,CAAC;CAGvB"}

View File

@@ -0,0 +1,248 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Glob = void 0;
const minimatch_1 = require("minimatch");
const node_url_1 = require("node:url");
const path_scurry_1 = require("path-scurry");
const pattern_js_1 = require("./pattern.js");
const walker_js_1 = require("./walker.js");
// if no process global, just call it linux.
// so we default to case-sensitive, / separators
const defaultPlatform = (typeof process === 'object' &&
process &&
typeof process.platform === 'string') ?
process.platform
: 'linux';
/**
* An object that can perform glob pattern traversals.
*/
class Glob {
absolute;
cwd;
root;
dot;
dotRelative;
follow;
ignore;
magicalBraces;
mark;
matchBase;
maxDepth;
nobrace;
nocase;
nodir;
noext;
noglobstar;
pattern;
platform;
realpath;
scurry;
stat;
signal;
windowsPathsNoEscape;
withFileTypes;
includeChildMatches;
/**
* The options provided to the constructor.
*/
opts;
/**
* An array of parsed immutable {@link Pattern} objects.
*/
patterns;
/**
* All options are stored as properties on the `Glob` object.
*
* See {@link GlobOptions} for full options descriptions.
*
* Note that a previous `Glob` object can be passed as the
* `GlobOptions` to another `Glob` instantiation to re-use settings
* and caches with a new pattern.
*
* Traversal functions can be called multiple times to run the walk
* again.
*/
constructor(pattern, opts) {
/* c8 ignore start */
if (!opts)
throw new TypeError('glob options required');
/* c8 ignore stop */
this.withFileTypes = !!opts.withFileTypes;
this.signal = opts.signal;
this.follow = !!opts.follow;
this.dot = !!opts.dot;
this.dotRelative = !!opts.dotRelative;
this.nodir = !!opts.nodir;
this.mark = !!opts.mark;
if (!opts.cwd) {
this.cwd = '';
}
else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {
opts.cwd = (0, node_url_1.fileURLToPath)(opts.cwd);
}
this.cwd = opts.cwd || '';
this.root = opts.root;
this.magicalBraces = !!opts.magicalBraces;
this.nobrace = !!opts.nobrace;
this.noext = !!opts.noext;
this.realpath = !!opts.realpath;
this.absolute = opts.absolute;
this.includeChildMatches = opts.includeChildMatches !== false;
this.noglobstar = !!opts.noglobstar;
this.matchBase = !!opts.matchBase;
this.maxDepth =
typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity;
this.stat = !!opts.stat;
this.ignore = opts.ignore;
if (this.withFileTypes && this.absolute !== undefined) {
throw new Error('cannot set absolute and withFileTypes:true');
}
if (typeof pattern === 'string') {
pattern = [pattern];
}
this.windowsPathsNoEscape =
!!opts.windowsPathsNoEscape ||
opts.allowWindowsEscape ===
false;
if (this.windowsPathsNoEscape) {
pattern = pattern.map(p => p.replace(/\\/g, '/'));
}
if (this.matchBase) {
if (opts.noglobstar) {
throw new TypeError('base matching requires globstar');
}
pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`));
}
this.pattern = pattern;
this.platform = opts.platform || defaultPlatform;
this.opts = { ...opts, platform: this.platform };
if (opts.scurry) {
this.scurry = opts.scurry;
if (opts.nocase !== undefined &&
opts.nocase !== opts.scurry.nocase) {
throw new Error('nocase option contradicts provided scurry option');
}
}
else {
const Scurry = opts.platform === 'win32' ? path_scurry_1.PathScurryWin32
: opts.platform === 'darwin' ? path_scurry_1.PathScurryDarwin
: opts.platform ? path_scurry_1.PathScurryPosix
: path_scurry_1.PathScurry;
this.scurry = new Scurry(this.cwd, {
nocase: opts.nocase,
fs: opts.fs,
});
}
this.nocase = this.scurry.nocase;
// If you do nocase:true on a case-sensitive file system, then
// we need to use regexps instead of strings for non-magic
// path portions, because statting `aBc` won't return results
// for the file `AbC` for example.
const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32';
const mmo = {
braceExpandMax: 10_000,
...opts,
dot: this.dot,
matchBase: this.matchBase,
nobrace: this.nobrace,
// default nocase based on platform
nocase: this.nocase,
nocaseMagicOnly,
nocomment: true,
noext: this.noext,
nonegate: true,
optimizationLevel: 2,
platform: this.platform,
windowsPathsNoEscape: this.windowsPathsNoEscape,
debug: !!this.opts.debug,
};
const mms = this.pattern.map(p => new minimatch_1.Minimatch(p, mmo));
const [matchSet, globParts] = mms.reduce((set, m) => {
set[0].push(...m.set);
set[1].push(...m.globParts);
return set;
}, [[], []]);
this.patterns = matchSet.map((set, i) => {
const g = globParts[i];
/* c8 ignore start */
if (!g)
throw new Error('invalid pattern object');
/* c8 ignore stop */
return new pattern_js_1.Pattern(set, g, 0, this.platform);
});
}
async walk() {
// Walkers always return array of Path objects, so we just have to
// coerce them into the right shape. It will have already called
// realpath() if the option was set to do so, so we know that's cached.
// start out knowing the cwd, at least
return [
...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
...this.opts,
maxDepth: this.maxDepth !== Infinity ?
this.maxDepth + this.scurry.cwd.depth()
: Infinity,
platform: this.platform,
nocase: this.nocase,
includeChildMatches: this.includeChildMatches,
}).walk()),
];
}
walkSync() {
return [
...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
...this.opts,
maxDepth: this.maxDepth !== Infinity ?
this.maxDepth + this.scurry.cwd.depth()
: Infinity,
platform: this.platform,
nocase: this.nocase,
includeChildMatches: this.includeChildMatches,
}).walkSync(),
];
}
stream() {
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
...this.opts,
maxDepth: this.maxDepth !== Infinity ?
this.maxDepth + this.scurry.cwd.depth()
: Infinity,
platform: this.platform,
nocase: this.nocase,
includeChildMatches: this.includeChildMatches,
}).stream();
}
streamSync() {
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
...this.opts,
maxDepth: this.maxDepth !== Infinity ?
this.maxDepth + this.scurry.cwd.depth()
: Infinity,
platform: this.platform,
nocase: this.nocase,
includeChildMatches: this.includeChildMatches,
}).streamSync();
}
/**
* Default sync iteration function. Returns a Generator that
* iterates over the results.
*/
iterateSync() {
return this.streamSync()[Symbol.iterator]();
}
[Symbol.iterator]() {
return this.iterateSync();
}
/**
* Default async iteration function. Returns an AsyncGenerator that
* iterates over the results.
*/
iterate() {
return this.stream()[Symbol.asyncIterator]();
}
[Symbol.asyncIterator]() {
return this.iterate();
}
}
exports.Glob = Glob;
//# sourceMappingURL=glob.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,14 @@
import { GlobOptions } from './glob.js';
/**
* Return true if the patterns provided contain any magic glob characters,
* given the options provided.
*
* Brace expansion is not considered "magic" unless the `magicalBraces` option
* is set, as brace expansion just turns one string into an array of strings.
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
* `'xby'` both do not contain any magic glob characters, and it's treated the
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
* is in the options, brace expansion _is_ treated as a pattern having magic.
*/
export declare const hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
//# sourceMappingURL=has-magic.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"has-magic.d.ts","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GACnB,SAAS,MAAM,GAAG,MAAM,EAAE,EAC1B,UAAS,WAAgB,KACxB,OAQF,CAAA"}

View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasMagic = void 0;
const minimatch_1 = require("minimatch");
/**
* Return true if the patterns provided contain any magic glob characters,
* given the options provided.
*
* Brace expansion is not considered "magic" unless the `magicalBraces` option
* is set, as brace expansion just turns one string into an array of strings.
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
* `'xby'` both do not contain any magic glob characters, and it's treated the
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
* is in the options, brace expansion _is_ treated as a pattern having magic.
*/
const hasMagic = (pattern, options = {}) => {
if (!Array.isArray(pattern)) {
pattern = [pattern];
}
for (const p of pattern) {
if (new minimatch_1.Minimatch(p, options).hasMagic())
return true;
}
return false;
};
exports.hasMagic = hasMagic;
//# sourceMappingURL=has-magic.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAGrC;;;;;;;;;;GAUG;AACI,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,IAAI,qBAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;IACvD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAXY,QAAA,QAAQ,YAWpB","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {},\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]}

View File

@@ -0,0 +1,24 @@
import { Minimatch, MinimatchOptions } from 'minimatch';
import { Path } from 'path-scurry';
import { GlobWalkerOpts } from './walker.js';
export interface IgnoreLike {
ignored?: (p: Path) => boolean;
childrenIgnored?: (p: Path) => boolean;
add?: (ignore: string) => void;
}
/**
* Class used to process ignored patterns
*/
export declare class Ignore implements IgnoreLike {
relative: Minimatch[];
relativeChildren: Minimatch[];
absolute: Minimatch[];
absoluteChildren: Minimatch[];
platform: NodeJS.Platform;
mmopts: MinimatchOptions;
constructor(ignored: string[], { nobrace, nocase, noext, noglobstar, platform, }: GlobWalkerOpts);
add(ign: string): void;
ignored(p: Path): boolean;
childrenIgnored(p: Path): boolean;
}
//# sourceMappingURL=ignore.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IACtC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAWD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,MAAM,EAAE,gBAAgB,CAAA;gBAGtB,OAAO,EAAE,MAAM,EAAE,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAA0B,GAC3B,EAAE,cAAc;IAqBnB,GAAG,CAAC,GAAG,EAAE,MAAM;IAyCf,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"}

View File

@@ -0,0 +1,119 @@
"use strict";
// give it a pattern, and it'll be able to tell you if
// a given path should be ignored.
// Ignoring a path ignores its children if the pattern ends in /**
// Ignores are always parsed in dot:true mode
Object.defineProperty(exports, "__esModule", { value: true });
exports.Ignore = void 0;
const minimatch_1 = require("minimatch");
const pattern_js_1 = require("./pattern.js");
const defaultPlatform = (typeof process === 'object' &&
process &&
typeof process.platform === 'string') ?
process.platform
: 'linux';
/**
* Class used to process ignored patterns
*/
class Ignore {
relative;
relativeChildren;
absolute;
absoluteChildren;
platform;
mmopts;
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) {
this.relative = [];
this.absolute = [];
this.relativeChildren = [];
this.absoluteChildren = [];
this.platform = platform;
this.mmopts = {
dot: true,
nobrace,
nocase,
noext,
noglobstar,
optimizationLevel: 2,
platform,
nocomment: true,
nonegate: true,
};
for (const ign of ignored)
this.add(ign);
}
add(ign) {
// this is a little weird, but it gives us a clean set of optimized
// minimatch matchers, without getting tripped up if one of them
// ends in /** inside a brace section, and it's only inefficient at
// the start of the walk, not along it.
// It'd be nice if the Pattern class just had a .test() method, but
// handling globstars is a bit of a pita, and that code already lives
// in minimatch anyway.
// Another way would be if maybe Minimatch could take its set/globParts
// as an option, and then we could at least just use Pattern to test
// for absolute-ness.
// Yet another way, Minimatch could take an array of glob strings, and
// a cwd option, and do the right thing.
const mm = new minimatch_1.Minimatch(ign, this.mmopts);
for (let i = 0; i < mm.set.length; i++) {
const parsed = mm.set[i];
const globParts = mm.globParts[i];
/* c8 ignore start */
if (!parsed || !globParts) {
throw new Error('invalid pattern object');
}
// strip off leading ./ portions
// https://github.com/isaacs/node-glob/issues/570
while (parsed[0] === '.' && globParts[0] === '.') {
parsed.shift();
globParts.shift();
}
/* c8 ignore stop */
const p = new pattern_js_1.Pattern(parsed, globParts, 0, this.platform);
const m = new minimatch_1.Minimatch(p.globString(), this.mmopts);
const children = globParts[globParts.length - 1] === '**';
const absolute = p.isAbsolute();
if (absolute)
this.absolute.push(m);
else
this.relative.push(m);
if (children) {
if (absolute)
this.absoluteChildren.push(m);
else
this.relativeChildren.push(m);
}
}
}
ignored(p) {
const fullpath = p.fullpath();
const fullpaths = `${fullpath}/`;
const relative = p.relative() || '.';
const relatives = `${relative}/`;
for (const m of this.relative) {
if (m.match(relative) || m.match(relatives))
return true;
}
for (const m of this.absolute) {
if (m.match(fullpath) || m.match(fullpaths))
return true;
}
return false;
}
childrenIgnored(p) {
const fullpath = p.fullpath() + '/';
const relative = (p.relative() || '.') + '/';
for (const m of this.relativeChildren) {
if (m.match(relative))
return true;
}
for (const m of this.absoluteChildren) {
if (m.match(fullpath))
return true;
}
return false;
}
}
exports.Ignore = Ignore;
//# sourceMappingURL=ignore.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,97 @@
import { Minipass } from 'minipass';
import { Path } from 'path-scurry';
import type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset } from './glob.js';
import { Glob } from './glob.js';
export { escape, unescape } from 'minimatch';
export type { FSOption, Path, WalkOptions, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset, } from 'path-scurry';
export { Glob } from './glob.js';
export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js';
export { hasMagic } from './has-magic.js';
export { Ignore } from './ignore.js';
export type { IgnoreLike } from './ignore.js';
export type { MatchStream } from './walker.js';
/**
* Syncronous form of {@link globStream}. Will read all the matches as fast as
* you consume them, even all in a single tick if you consume them immediately,
* but will still respond to backpressure if they're not consumed immediately.
*/
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesUnset): Minipass<string, string>;
export declare function globStreamSync(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
/**
* Return a stream that emits all the strings or `Path` objects and
* then emits `end` when completed.
*/
export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
export declare function globStream(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Minipass<string, string>;
export declare function globStream(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
/**
* Synchronous form of {@link glob}
*/
export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): string[];
export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Path[];
export declare function globSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): string[];
export declare function globSync(pattern: string | string[], options: GlobOptions): Path[] | string[];
/**
* Perform an asynchronous glob search for the pattern(s) specified. Returns
* [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the
* {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for
* full option descriptions.
*/
declare function glob_(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Promise<string[]>;
declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Promise<Path[]>;
declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Promise<string[]>;
declare function glob_(pattern: string | string[], options: GlobOptions): Promise<Path[] | string[]>;
/**
* Return a sync iterator for walking glob pattern matches.
*/
export declare function globIterateSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Generator<string, void, void>;
export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Generator<Path, void, void>;
export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Generator<string, void, void>;
export declare function globIterateSync(pattern: string | string[], options: GlobOptions): Generator<Path, void, void> | Generator<string, void, void>;
/**
* Return an async iterator for walking glob pattern matches.
*/
export declare function globIterate(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): AsyncGenerator<string, void, void>;
export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): AsyncGenerator<Path, void, void>;
export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): AsyncGenerator<string, void, void>;
export declare function globIterate(pattern: string | string[], options: GlobOptions): AsyncGenerator<Path, void, void> | AsyncGenerator<string, void, void>;
export declare const streamSync: typeof globStreamSync;
export declare const stream: typeof globStream & {
sync: typeof globStreamSync;
};
export declare const iterateSync: typeof globIterateSync;
export declare const iterate: typeof globIterate & {
sync: typeof globIterateSync;
};
export declare const sync: typeof globSync & {
stream: typeof globStreamSync;
iterate: typeof globIterateSync;
};
export declare const glob: typeof glob_ & {
glob: typeof glob_;
globSync: typeof globSync;
sync: typeof globSync & {
stream: typeof globStreamSync;
iterate: typeof globIterateSync;
};
globStream: typeof globStream;
stream: typeof globStream & {
sync: typeof globStreamSync;
};
globStreamSync: typeof globStreamSync;
streamSync: typeof globStreamSync;
globIterate: typeof globIterate;
iterate: typeof globIterate & {
sync: typeof globIterateSync;
};
globIterateSync: typeof globIterateSync;
iterateSync: typeof globIterateSync;
Glob: typeof Glob;
hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC5C,YAAY,EACV,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,YAAY,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,4BAA4B,GACpC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACvB,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,6BAA6B,GACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC3B,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
Object.defineProperty(exports, "__esModule", { value: true });
exports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = void 0;
exports.globStreamSync = globStreamSync;
exports.globStream = globStream;
exports.globSync = globSync;
exports.globIterateSync = globIterateSync;
exports.globIterate = globIterate;
const minimatch_1 = require("minimatch");
const glob_js_1 = require("./glob.js");
const has_magic_js_1 = require("./has-magic.js");
var minimatch_2 = require("minimatch");
Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return minimatch_2.escape; } });
Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return minimatch_2.unescape; } });
var glob_js_2 = require("./glob.js");
Object.defineProperty(exports, "Glob", { enumerable: true, get: function () { return glob_js_2.Glob; } });
var has_magic_js_2 = require("./has-magic.js");
Object.defineProperty(exports, "hasMagic", { enumerable: true, get: function () { return has_magic_js_2.hasMagic; } });
var ignore_js_1 = require("./ignore.js");
Object.defineProperty(exports, "Ignore", { enumerable: true, get: function () { return ignore_js_1.Ignore; } });
function globStreamSync(pattern, options = {}) {
return new glob_js_1.Glob(pattern, options).streamSync();
}
function globStream(pattern, options = {}) {
return new glob_js_1.Glob(pattern, options).stream();
}
function globSync(pattern, options = {}) {
return new glob_js_1.Glob(pattern, options).walkSync();
}
async function glob_(pattern, options = {}) {
return new glob_js_1.Glob(pattern, options).walk();
}
function globIterateSync(pattern, options = {}) {
return new glob_js_1.Glob(pattern, options).iterateSync();
}
function globIterate(pattern, options = {}) {
return new glob_js_1.Glob(pattern, options).iterate();
}
// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc
exports.streamSync = globStreamSync;
exports.stream = Object.assign(globStream, { sync: globStreamSync });
exports.iterateSync = globIterateSync;
exports.iterate = Object.assign(globIterate, {
sync: globIterateSync,
});
exports.sync = Object.assign(globSync, {
stream: globStreamSync,
iterate: globIterateSync,
});
exports.glob = Object.assign(glob_, {
glob: glob_,
globSync,
sync: exports.sync,
globStream,
stream: exports.stream,
globStreamSync,
streamSync: exports.streamSync,
globIterate,
iterate: exports.iterate,
globIterateSync,
iterateSync: exports.iterateSync,
Glob: glob_js_1.Glob,
hasMagic: has_magic_js_1.hasMagic,
escape: minimatch_1.escape,
unescape: minimatch_1.unescape,
});
exports.glob.glob = exports.glob;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
{
"type": "commonjs"
}

Some files were not shown because too many files have changed in this diff Show More