@rushstack/heft-config-file
Advanced tools
Comparing version 0.8.10 to 0.9.0
@@ -78,4 +78,22 @@ import { ITerminal } from '@rushstack/node-core-library'; | ||
/** | ||
* Used to specify how node(s) in a JSON object should be processed after being loaded. | ||
* | ||
* @beta | ||
*/ | ||
export declare interface ICustomJsonPathMetadata { | ||
/** | ||
* If `ICustomJsonPathMetadata.pathResolutionMethod` is set to `PathResolutionMethod.custom`, | ||
* this property be used to resolve the path. | ||
*/ | ||
customResolver?: (configurationFilePath: string, propertyName: string, propertyValue: string) => string; | ||
/** | ||
* If this property describes a filesystem path, use this property to describe | ||
* how the path should be resolved. | ||
*/ | ||
pathResolutionMethod?: PathResolutionMethod.custom; | ||
} | ||
/** | ||
* @beta | ||
*/ | ||
export declare interface ICustomPropertyInheritance<TObject> extends IPropertyInheritance<InheritanceType.custom> { | ||
@@ -91,18 +109,5 @@ /** | ||
/** | ||
* Used to specify how node(s) in a JSON object should be processed after being loaded. | ||
* | ||
* @beta | ||
*/ | ||
export declare interface IJsonPathMetadata { | ||
/** | ||
* If `IJsonPathMetadata.pathResolutionMethod` is set to `PathResolutionMethod.custom`, | ||
* this property be used to resolve the path. | ||
*/ | ||
customResolver?: (configurationFilePath: string, propertyName: string, propertyValue: string) => string; | ||
/** | ||
* If this property describes a filesystem path, use this property to describe | ||
* how the path should be resolved. | ||
*/ | ||
pathResolutionMethod?: PathResolutionMethod; | ||
} | ||
export declare type IJsonPathMetadata = ICustomJsonPathMetadata | INonCustomJsonPathMetadata; | ||
@@ -144,4 +149,17 @@ /** | ||
/** | ||
* Used to specify how node(s) in a JSON object should be processed after being loaded. | ||
* | ||
* @beta | ||
*/ | ||
export declare interface INonCustomJsonPathMetadata { | ||
/** | ||
* If this property describes a filesystem path, use this property to describe | ||
* how the path should be resolved. | ||
*/ | ||
pathResolutionMethod?: PathResolutionMethod.NodeResolve | PathResolutionMethod.nodeResolve | PathResolutionMethod.resolvePathRelativeToConfigurationFile | PathResolutionMethod.resolvePathRelativeToProjectRoot; | ||
} | ||
/** | ||
* @beta | ||
*/ | ||
export declare interface IOriginalValueOptions<TParentProperty> { | ||
@@ -173,16 +191,24 @@ parentObject: Partial<TParentProperty>; | ||
*/ | ||
resolvePathRelativeToConfigurationFile = 0, | ||
resolvePathRelativeToConfigurationFile = "resolvePathRelativeToConfigurationFile", | ||
/** | ||
* Resolve a path relative to the root of the project containing the configuration file | ||
*/ | ||
resolvePathRelativeToProjectRoot = 1, | ||
resolvePathRelativeToProjectRoot = "resolvePathRelativeToProjectRoot", | ||
/** | ||
* Treat the property as a NodeJS-style require/import reference and resolve using standard | ||
* NodeJS filesystem resolution | ||
* | ||
* @deprecated | ||
* Use {@link PathResolutionMethod.nodeResolve} instead | ||
*/ | ||
NodeResolve = 2, | ||
NodeResolve = "NodeResolve", | ||
/** | ||
* Treat the property as a NodeJS-style require/import reference and resolve using standard | ||
* NodeJS filesystem resolution | ||
*/ | ||
nodeResolve = "nodeResolve", | ||
/** | ||
* Resolve the property using a custom resolver. | ||
*/ | ||
custom = 3 | ||
custom = "custom" | ||
} | ||
@@ -189,0 +215,0 @@ |
@@ -33,16 +33,24 @@ import { ITerminal } from '@rushstack/node-core-library'; | ||
*/ | ||
resolvePathRelativeToConfigurationFile = 0, | ||
resolvePathRelativeToConfigurationFile = "resolvePathRelativeToConfigurationFile", | ||
/** | ||
* Resolve a path relative to the root of the project containing the configuration file | ||
*/ | ||
resolvePathRelativeToProjectRoot = 1, | ||
resolvePathRelativeToProjectRoot = "resolvePathRelativeToProjectRoot", | ||
/** | ||
* Treat the property as a NodeJS-style require/import reference and resolve using standard | ||
* NodeJS filesystem resolution | ||
* | ||
* @deprecated | ||
* Use {@link PathResolutionMethod.nodeResolve} instead | ||
*/ | ||
NodeResolve = 2, | ||
NodeResolve = "NodeResolve", | ||
/** | ||
* Treat the property as a NodeJS-style require/import reference and resolve using standard | ||
* NodeJS filesystem resolution | ||
*/ | ||
nodeResolve = "nodeResolve", | ||
/** | ||
* Resolve the property using a custom resolver. | ||
*/ | ||
custom = 3 | ||
custom = "custom" | ||
} | ||
@@ -54,5 +62,5 @@ /** | ||
*/ | ||
export interface IJsonPathMetadata { | ||
export interface ICustomJsonPathMetadata { | ||
/** | ||
* If `IJsonPathMetadata.pathResolutionMethod` is set to `PathResolutionMethod.custom`, | ||
* If `ICustomJsonPathMetadata.pathResolutionMethod` is set to `PathResolutionMethod.custom`, | ||
* this property be used to resolve the path. | ||
@@ -65,7 +73,19 @@ */ | ||
*/ | ||
pathResolutionMethod?: PathResolutionMethod; | ||
pathResolutionMethod?: PathResolutionMethod.custom; | ||
} | ||
/** | ||
* Used to specify how node(s) in a JSON object should be processed after being loaded. | ||
* | ||
* @beta | ||
*/ | ||
export interface INonCustomJsonPathMetadata { | ||
/** | ||
* If this property describes a filesystem path, use this property to describe | ||
* how the path should be resolved. | ||
*/ | ||
pathResolutionMethod?: PathResolutionMethod.NodeResolve | PathResolutionMethod.nodeResolve | PathResolutionMethod.resolvePathRelativeToConfigurationFile | PathResolutionMethod.resolvePathRelativeToProjectRoot; | ||
} | ||
/** | ||
* @beta | ||
*/ | ||
export declare type PropertyInheritanceCustomFunction<TObject> = (currentObject: TObject, parentObject: TObject) => TObject; | ||
@@ -96,2 +116,6 @@ /** | ||
/** | ||
* @beta | ||
*/ | ||
export declare type IJsonPathMetadata = ICustomJsonPathMetadata | INonCustomJsonPathMetadata; | ||
/** | ||
* Keys in this object are JSONPaths {@link https://jsonpath.com/}, and values are objects | ||
@@ -98,0 +122,0 @@ * that describe how node(s) selected by the JSONPath are processed after loading. |
@@ -64,16 +64,24 @@ "use strict"; | ||
*/ | ||
PathResolutionMethod[PathResolutionMethod["resolvePathRelativeToConfigurationFile"] = 0] = "resolvePathRelativeToConfigurationFile"; | ||
PathResolutionMethod["resolvePathRelativeToConfigurationFile"] = "resolvePathRelativeToConfigurationFile"; | ||
/** | ||
* Resolve a path relative to the root of the project containing the configuration file | ||
*/ | ||
PathResolutionMethod[PathResolutionMethod["resolvePathRelativeToProjectRoot"] = 1] = "resolvePathRelativeToProjectRoot"; | ||
PathResolutionMethod["resolvePathRelativeToProjectRoot"] = "resolvePathRelativeToProjectRoot"; | ||
/** | ||
* Treat the property as a NodeJS-style require/import reference and resolve using standard | ||
* NodeJS filesystem resolution | ||
* | ||
* @deprecated | ||
* Use {@link PathResolutionMethod.nodeResolve} instead | ||
*/ | ||
PathResolutionMethod[PathResolutionMethod["NodeResolve"] = 2] = "NodeResolve"; | ||
PathResolutionMethod["NodeResolve"] = "NodeResolve"; | ||
/** | ||
* Treat the property as a NodeJS-style require/import reference and resolve using standard | ||
* NodeJS filesystem resolution | ||
*/ | ||
PathResolutionMethod["nodeResolve"] = "nodeResolve"; | ||
/** | ||
* Resolve the property using a custom resolver. | ||
*/ | ||
PathResolutionMethod[PathResolutionMethod["custom"] = 3] = "custom"; | ||
PathResolutionMethod["custom"] = "custom"; | ||
})(PathResolutionMethod = exports.PathResolutionMethod || (exports.PathResolutionMethod = {})); | ||
@@ -303,3 +311,4 @@ const CONFIGURATION_FILE_MERGE_BEHAVIOR_FIELD_REGEX = /^\$([^\.]+)\.inheritanceType$/; | ||
} | ||
case PathResolutionMethod.NodeResolve: { | ||
case PathResolutionMethod.NodeResolve: // TODO: Remove | ||
case PathResolutionMethod.nodeResolve: { | ||
return node_core_library_1.Import.resolveModule({ | ||
@@ -306,0 +315,0 @@ modulePath: propertyValue, |
@@ -1,2 +0,2 @@ | ||
export { ConfigurationFile, IConfigurationFileOptions, ICustomPropertyInheritance, IJsonPathMetadata, IJsonPathsMetadata, InheritanceType, IOriginalValueOptions, IPropertiesInheritance, IPropertyInheritance, PathResolutionMethod, PropertyInheritanceCustomFunction } from './ConfigurationFile'; | ||
export { ConfigurationFile, IConfigurationFileOptions, ICustomJsonPathMetadata, ICustomPropertyInheritance, IJsonPathMetadata, IJsonPathsMetadata, InheritanceType, INonCustomJsonPathMetadata, IOriginalValueOptions, IPropertiesInheritance, IPropertyInheritance, PathResolutionMethod, PropertyInheritanceCustomFunction } from './ConfigurationFile'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@rushstack/heft-config-file", | ||
"version": "0.8.10", | ||
"version": "0.9.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
94797
931