@rushstack/heft-config-file
Advanced tools
Comparing version 0.10.0 to 0.11.0
@@ -8,4 +8,4 @@ import { ITerminal } from '@rushstack/node-core-library'; | ||
export declare class ConfigurationFile<TConfigurationFile> { | ||
private readonly _schemaPath; | ||
/** {@inheritDoc IConfigurationFileOptions.projectRelativeFilePath} */ | ||
private readonly _getSchema; | ||
/** {@inheritDoc IConfigurationFileOptionsBase.projectRelativeFilePath} */ | ||
readonly projectRelativeFilePath: string; | ||
@@ -59,3 +59,8 @@ private readonly _jsonPathMetadata; | ||
*/ | ||
export declare interface IConfigurationFileOptions<TConfigurationFile> { | ||
export declare type IConfigurationFileOptions<TConfigurationFile> = IConfigurationFileOptionsWithJsonSchemaFilePath<TConfigurationFile> | IConfigurationFileOptionsWithJsonSchemaObject<TConfigurationFile>; | ||
/** | ||
* @beta | ||
*/ | ||
export declare interface IConfigurationFileOptionsBase<TConfigurationFile> { | ||
/** | ||
@@ -66,6 +71,2 @@ * A project root-relative path to the configuration file that should be loaded. | ||
/** | ||
* The path to the schema for the configuration file. | ||
*/ | ||
jsonSchemaPath: string; | ||
/** | ||
* Use this property to specify how JSON nodes are postprocessed. | ||
@@ -87,2 +88,24 @@ */ | ||
/** | ||
* @beta | ||
*/ | ||
export declare interface IConfigurationFileOptionsWithJsonSchemaFilePath<TConfigurationFile> extends IConfigurationFileOptionsBase<TConfigurationFile> { | ||
/** | ||
* The path to the schema for the configuration file. | ||
*/ | ||
jsonSchemaPath: string; | ||
jsonSchemaObject?: never; | ||
} | ||
/** | ||
* @beta | ||
*/ | ||
export declare interface IConfigurationFileOptionsWithJsonSchemaObject<TConfigurationFile> extends IConfigurationFileOptionsBase<TConfigurationFile> { | ||
/** | ||
* The schema for the configuration file. | ||
*/ | ||
jsonSchemaObject: object; | ||
jsonSchemaPath?: never; | ||
} | ||
/** | ||
* Used to specify how node(s) in a JSON object should be processed after being loaded. | ||
@@ -89,0 +112,0 @@ * |
@@ -135,3 +135,3 @@ import { ITerminal } from '@rushstack/node-core-library'; | ||
*/ | ||
export interface IConfigurationFileOptions<TConfigurationFile> { | ||
export interface IConfigurationFileOptionsBase<TConfigurationFile> { | ||
/** | ||
@@ -142,6 +142,2 @@ * A project root-relative path to the configuration file that should be loaded. | ||
/** | ||
* The path to the schema for the configuration file. | ||
*/ | ||
jsonSchemaPath: string; | ||
/** | ||
* Use this property to specify how JSON nodes are postprocessed. | ||
@@ -164,2 +160,26 @@ */ | ||
*/ | ||
export interface IConfigurationFileOptionsWithJsonSchemaFilePath<TConfigurationFile> extends IConfigurationFileOptionsBase<TConfigurationFile> { | ||
/** | ||
* The path to the schema for the configuration file. | ||
*/ | ||
jsonSchemaPath: string; | ||
jsonSchemaObject?: never; | ||
} | ||
/** | ||
* @beta | ||
*/ | ||
export interface IConfigurationFileOptionsWithJsonSchemaObject<TConfigurationFile> extends IConfigurationFileOptionsBase<TConfigurationFile> { | ||
/** | ||
* The schema for the configuration file. | ||
*/ | ||
jsonSchemaObject: object; | ||
jsonSchemaPath?: never; | ||
} | ||
/** | ||
* @beta | ||
*/ | ||
export declare type IConfigurationFileOptions<TConfigurationFile> = IConfigurationFileOptionsWithJsonSchemaFilePath<TConfigurationFile> | IConfigurationFileOptionsWithJsonSchemaObject<TConfigurationFile>; | ||
/** | ||
* @beta | ||
*/ | ||
export interface IOriginalValueOptions<TParentProperty> { | ||
@@ -173,4 +193,4 @@ parentObject: Partial<TParentProperty>; | ||
export declare class ConfigurationFile<TConfigurationFile> { | ||
private readonly _schemaPath; | ||
/** {@inheritDoc IConfigurationFileOptions.projectRelativeFilePath} */ | ||
private readonly _getSchema; | ||
/** {@inheritDoc IConfigurationFileOptionsBase.projectRelativeFilePath} */ | ||
readonly projectRelativeFilePath: string; | ||
@@ -177,0 +197,0 @@ private readonly _jsonPathMetadata; |
@@ -97,3 +97,8 @@ "use strict"; | ||
this.projectRelativeFilePath = options.projectRelativeFilePath; | ||
this._schemaPath = options.jsonSchemaPath; | ||
if (options.jsonSchemaObject) { | ||
this._getSchema = () => node_core_library_1.JsonSchema.fromLoadedObject(options.jsonSchemaObject); | ||
} | ||
else { | ||
this._getSchema = () => node_core_library_1.JsonSchema.fromFile(options.jsonSchemaPath); | ||
} | ||
this._jsonPathMetadata = options.jsonPathMetadata || {}; | ||
@@ -105,3 +110,3 @@ this._propertyInheritanceTypes = options.propertyInheritance || {}; | ||
if (!this.__schema) { | ||
this.__schema = node_core_library_1.JsonSchema.fromFile(this._schemaPath); | ||
this.__schema = this._getSchema(); | ||
} | ||
@@ -108,0 +113,0 @@ return this.__schema; |
@@ -1,2 +0,2 @@ | ||
export { ConfigurationFile, IConfigurationFileOptions, ICustomJsonPathMetadata, ICustomPropertyInheritance, IJsonPathMetadata, IJsonPathsMetadata, InheritanceType, INonCustomJsonPathMetadata, IOriginalValueOptions, IPropertiesInheritance, IPropertyInheritance, IPropertyInheritanceDefaults, PathResolutionMethod, PropertyInheritanceCustomFunction } from './ConfigurationFile'; | ||
export { ConfigurationFile, IConfigurationFileOptionsBase, IConfigurationFileOptionsWithJsonSchemaFilePath, IConfigurationFileOptionsWithJsonSchemaObject, IConfigurationFileOptions, ICustomJsonPathMetadata, ICustomPropertyInheritance, IJsonPathMetadata, IJsonPathsMetadata, InheritanceType, INonCustomJsonPathMetadata, IOriginalValueOptions, IPropertiesInheritance, IPropertyInheritance, IPropertyInheritanceDefaults, PathResolutionMethod, PropertyInheritanceCustomFunction } from './ConfigurationFile'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@rushstack/heft-config-file", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "Configuration file loader for @rushstack/heft", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
102805
1023