@rnx-kit/config
Advanced tools
Comparing version
@@ -138,6 +138,4 @@ import type { PluginOptions as CyclicDetectorOptions } from "@rnx-kit/metro-plugin-cyclic-dependencies-detector"; | ||
*/ | ||
platforms?: { | ||
[K in AllPlatforms]?: BundleParameters; | ||
}; | ||
platforms?: Partial<Record<AllPlatforms, BundleParameters>>; | ||
}; | ||
//# sourceMappingURL=bundleConfig.d.ts.map |
@@ -0,1 +1,2 @@ | ||
import type { PackageManifest } from "@rnx-kit/tools-node/package"; | ||
import type { KitConfig } from "./kitConfig"; | ||
@@ -21,2 +22,9 @@ /** | ||
export declare function getKitConfig(options?: GetKitConfigOptions): KitConfig | undefined; | ||
/** | ||
* Helper for loading the KitConfig for cases where the package.json has already been loaded for other reasons. | ||
* @param packageJson The loaded and parsed package.json file for this package. | ||
* @param packageDir The directory containing the package.json file. | ||
* @returns The rnx-kit configuration for this package, merged with any base configuration. | ||
*/ | ||
export declare function getKitConfigFromPackageManifest(packageJson: PackageManifest, packageDir: string): KitConfig | undefined; | ||
//# sourceMappingURL=getKitConfig.d.ts.map |
@@ -18,9 +18,19 @@ "use strict"; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importStar = (this && this.__importStar) || (function () { | ||
var ownKeys = function(o) { | ||
ownKeys = Object.getOwnPropertyNames || function (o) { | ||
var ar = []; | ||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||
return ar; | ||
}; | ||
return ownKeys(o); | ||
}; | ||
return function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
})(); | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -31,2 +41,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.getKitConfig = getKitConfig; | ||
exports.getKitConfigFromPackageManifest = getKitConfigFromPackageManifest; | ||
const package_1 = require("@rnx-kit/tools-node/package"); | ||
@@ -69,2 +80,11 @@ const lodash_merge_1 = __importDefault(require("lodash.merge")); | ||
} | ||
/** | ||
* Helper for loading the KitConfig for cases where the package.json has already been loaded for other reasons. | ||
* @param packageJson The loaded and parsed package.json file for this package. | ||
* @param packageDir The directory containing the package.json file. | ||
* @returns The rnx-kit configuration for this package, merged with any base configuration. | ||
*/ | ||
function getKitConfigFromPackageManifest(packageJson, packageDir) { | ||
return loadBaseConfig(packageJson["rnx-kit"], packageDir); | ||
} | ||
//# sourceMappingURL=getKitConfig.js.map |
@@ -5,3 +5,3 @@ export type { BundleConfig, BundleParameters, BundlerPlugins, HermesOptions, TypeScriptValidationOptions, } from "./bundleConfig"; | ||
export type { KitCapabilities } from "./getKitCapabilities"; | ||
export { getKitConfig } from "./getKitConfig"; | ||
export { getKitConfig, getKitConfigFromPackageManifest } from "./getKitConfig"; | ||
export type { GetKitConfigOptions } from "./getKitConfig"; | ||
@@ -8,0 +8,0 @@ export type { Capability, DependencyVersions, GetDependencyVersions, KitConfig, KitType, MetaCapability, } from "./kitConfig"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getKitConfig = exports.getKitCapabilities = exports.getPlatformBundleConfig = exports.getBundleConfig = void 0; | ||
exports.getKitConfigFromPackageManifest = exports.getKitConfig = exports.getKitCapabilities = exports.getPlatformBundleConfig = exports.getBundleConfig = void 0; | ||
var getBundleConfig_1 = require("./getBundleConfig"); | ||
@@ -11,2 +11,3 @@ Object.defineProperty(exports, "getBundleConfig", { enumerable: true, get: function () { return getBundleConfig_1.getBundleConfig; } }); | ||
Object.defineProperty(exports, "getKitConfig", { enumerable: true, get: function () { return getKitConfig_1.getKitConfig; } }); | ||
Object.defineProperty(exports, "getKitConfigFromPackageManifest", { enumerable: true, get: function () { return getKitConfig_1.getKitConfigFromPackageManifest; } }); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@rnx-kit/config", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "Define and query information about a kit package", | ||
@@ -55,3 +55,3 @@ "homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/config#readme", | ||
"eslint": "^9.0.0", | ||
"metro": "^0.80.3", | ||
"metro": "^0.81.0", | ||
"prettier": "^3.0.0", | ||
@@ -58,0 +58,0 @@ "typescript": "^5.0.0" |
@@ -159,3 +159,3 @@ import type { PluginOptions as CyclicDetectorOptions } from "@rnx-kit/metro-plugin-cyclic-dependencies-detector"; | ||
*/ | ||
platforms?: { [K in AllPlatforms]?: BundleParameters }; | ||
platforms?: Partial<Record<AllPlatforms, BundleParameters>>; | ||
}; |
@@ -72,1 +72,14 @@ import type { PackageManifest } from "@rnx-kit/tools-node/package"; | ||
} | ||
/** | ||
* Helper for loading the KitConfig for cases where the package.json has already been loaded for other reasons. | ||
* @param packageJson The loaded and parsed package.json file for this package. | ||
* @param packageDir The directory containing the package.json file. | ||
* @returns The rnx-kit configuration for this package, merged with any base configuration. | ||
*/ | ||
export function getKitConfigFromPackageManifest( | ||
packageJson: PackageManifest, | ||
packageDir: string | ||
): KitConfig | undefined { | ||
return loadBaseConfig(packageJson["rnx-kit"], packageDir); | ||
} |
@@ -14,3 +14,3 @@ export type { | ||
export { getKitConfig } from "./getKitConfig"; | ||
export { getKitConfig, getKitConfigFromPackageManifest } from "./getKitConfig"; | ||
export type { GetKitConfigOptions } from "./getKitConfig"; | ||
@@ -17,0 +17,0 @@ |
60147
3.95%1093
3.7%