Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rushstack/rig-package

Package Overview
Dependencies
Maintainers
3
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rushstack/rig-package - npm Package Compare versions

Comparing version 0.3.21 to 0.4.0

168

dist/rig-package.d.ts

@@ -33,2 +33,99 @@ /**

/**
* This is the main API for loading the `config/rig.json` file format.
*
* @public
*/
export declare interface IRigConfig {
/**
* The project folder path that was passed to {@link RigConfig.loadForProjectFolder},
* which maybe an absolute or relative path.
*
* @remarks
* Example: `.`
*/
readonly projectFolderOriginalPath: string;
/**
* The absolute path for the project folder path that was passed to {@link RigConfig.loadForProjectFolder}.
*
* @remarks
* Example: `/path/to/your-project`
*/
readonly projectFolderPath: string;
/**
* Returns `true` if `config/rig.json` was found, or `false` otherwise.
*/
readonly rigFound: boolean;
/**
* The full path to the `rig.json` file that was found, or `""` if none was found.
*
* @remarks
* Example: `/path/to/your-project/config/rig.json`
*/
readonly filePath: string;
/**
* The `"rigPackageName"` field from `rig.json`, or `""` if the file was not found.
*
* @remarks
* The name must be a valid NPM package name, and must end with the `-rig` suffix.
*
* Example: `example-rig`
*/
readonly rigPackageName: string;
/**
* The `"rigProfile"` value that was loaded from `rig.json`, or `""` if the file was not found.
*
* @remarks
* The name must consist of lowercase alphanumeric words separated by hyphens, for example `"sample-profile"`.
* If the `rig.json` file exists, but the `"rigProfile"` is not specified, then the profile
* name will be `"default"`.
*
* Example: `example-profile`
*/
readonly rigProfile: string;
/**
* The relative path to the rig profile specified by `rig.json`, or `""` if the file was not found.
*
* @remarks
* Example: `profiles/example-profile`
*/
readonly relativeProfileFolderPath: string;
/**
* Performs Node.js module resolution to locate the rig package folder, then returns the absolute path
* of the rig profile folder specified by `rig.json`.
*
* @remarks
* If no `rig.json` file was found, then this method throws an error. The first time this method
* is called, the result is cached and will be returned by all subsequent calls.
*
* Example: `/path/to/your-project/node_modules/example-rig/profiles/example-profile`
*/
getResolvedProfileFolder(): string;
/**
* An async variant of {@link IRigConfig.getResolvedProfileFolder}
*/
getResolvedProfileFolderAsync(): Promise<string>;
/**
* This lookup first checks for the specified relative path under `projectFolderPath`; if it does
* not exist there, then it checks in the resolved rig profile folder. If the file is found,
* its absolute path is returned. Otherwise, `undefined` is returned.
*
* @remarks
* For example, suppose the rig profile is:
*
* `/path/to/your-project/node_modules/example-rig/profiles/example-profile`
*
* And suppose `configFileRelativePath` is `folder/file.json`. Then the following locations will be checked:
*
* `/path/to/your-project/folder/file.json`
*
* `/path/to/your-project/node_modules/example-rig/profiles/example-profile/folder/file.json`
*/
tryResolveConfigFilePath(configFileRelativePath: string): string | undefined;
/**
* An async variant of {@link IRigConfig.tryResolveConfigFilePath}
*/
tryResolveConfigFilePathAsync(configFileRelativePath: string): Promise<string | undefined>;
}
/**
* Represents the literal contents of the `config/rig.json` file.

@@ -61,7 +158,7 @@ *

/**
* This is the main API for loading the `config/rig.json` file format.
* {@inheritdoc IRigConfig}
*
* @public
*/
export declare class RigConfig {
export declare class RigConfig implements IRigConfig {
private static readonly _packageNameRegExp;

@@ -84,52 +181,27 @@ private static readonly _rigNameRegExp;

/**
* The project folder path that was passed to {@link RigConfig.loadForProjectFolder},
* which maybe an absolute or relative path.
*
* @remarks
* Example: `.`
* {@inheritdoc IRigConfig.projectFolderOriginalPath}
*/
readonly projectFolderOriginalPath: string;
/**
* The absolute path for the project folder path that was passed to {@link RigConfig.loadForProjectFolder}.
*
* @remarks
* Example: `/path/to/your-project`
* {@inheritdoc IRigConfig.projectFolderPath}
*/
readonly projectFolderPath: string;
/**
* Returns `true` if `config/rig.json` was found, or `false` otherwise.
* {@inheritdoc IRigConfig.rigFound}
*/
readonly rigFound: boolean;
/**
* The full path to the `rig.json` file that was found, or `""` if none was found.
*
* @remarks
* Example: `/path/to/your-project/config/rig.json`
* {@inheritdoc IRigConfig.filePath}
*/
readonly filePath: string;
/**
* The `"rigPackageName"` field from `rig.json`, or `""` if the file was not found.
*
* @remarks
* The name must be a valid NPM package name, and must end with the `-rig` suffix.
*
* Example: `example-rig`
* {@inheritdoc IRigConfig.rigPackageName}
*/
readonly rigPackageName: string;
/**
* The `"rigProfile"` value that was loaded from `rig.json`, or `""` if the file was not found.
*
* @remarks
* The name must consist of lowercase alphanumeric words separated by hyphens, for example `"sample-profile"`.
* If the `rig.json` file exists, but the `"rigProfile"` is not specified, then the profile
* name will be `"default"`.
*
* Example: `example-profile`
* {@inheritdoc IRigConfig.rigProfile}
*/
readonly rigProfile: string;
/**
* The relative path to the rig profile specified by `rig.json`, or `""` if the file was not found.
*
* @remarks
* Example: `profiles/example-profile`
* {@inheritdoc IRigConfig.relativeProfileFolderPath}
*/

@@ -163,35 +235,15 @@ readonly relativeProfileFolderPath: string;

/**
* Performs Node.js module resolution to locate the rig package folder, then returns the absolute path
* of the rig profile folder specified by `rig.json`.
*
* @remarks
* If no `rig.json` file was found, then this method throws an error. The first time this method
* is called, the result is cached and will be returned by all subsequent calls.
*
* Example: `/path/to/your-project/node_modules/example-rig/profiles/example-profile`
* {@inheritdoc IRigConfig.getResolvedProfileFolder}
*/
getResolvedProfileFolder(): string;
/**
* An async variant of {@link RigConfig.getResolvedProfileFolder}
* {@inheritdoc IRigConfig.getResolvedProfileFolderAsync}
*/
getResolvedProfileFolderAsync(): Promise<string>;
/**
* This lookup first checks for the specified relative path under `projectFolderPath`; if it does
* not exist there, then it checks in the resolved rig profile folder. If the file is found,
* its absolute path is returned. Otherwise, `undefined` is returned.
*
* @remarks
* For example, suppose the rig profile is:
*
* `/path/to/your-project/node_modules/example-rig/profiles/example-profile`
*
* And suppose `configFileRelativePath` is `folder/file.json`. Then the following locations will be checked:
*
* `/path/to/your-project/folder/file.json`
*
* `/path/to/your-project/node_modules/example-rig/profiles/example-profile/folder/file.json`
* {@inheritdoc IRigConfig.tryResolveConfigFilePath}
*/
tryResolveConfigFilePath(configFileRelativePath: string): string | undefined;
/**
* An async variant of {@link RigConfig.tryResolveConfigFilePath}
* {@inheritdoc IRigConfig.tryResolveConfigFilePathAsync}
*/

@@ -198,0 +250,0 @@ tryResolveConfigFilePathAsync(configFileRelativePath: string): Promise<string | undefined>;

@@ -11,3 +11,3 @@ /**

*/
export { IRigConfigJson, RigConfig, ILoadForProjectFolderOptions } from './RigConfig';
export { type IRigConfigJson, type IRigConfig, RigConfig, type ILoadForProjectFolderOptions } from './RigConfig';
//# sourceMappingURL=index.d.ts.map

@@ -51,20 +51,4 @@ /**

*/
export declare class RigConfig {
private static readonly _packageNameRegExp;
private static readonly _rigNameRegExp;
private static readonly _profileNameRegExp;
export interface IRigConfig {
/**
* Returns the absolute path of the `rig.schema.json` JSON schema file for `config/rig.json`,
* which is bundled with this NPM package.
*
* @remarks
* The `RigConfig` class already performs schema validation when loading `rig.json`; however
* this schema file may be useful for integration with other validation tools.
*
* @public
*/
static jsonSchemaPath: string;
private static _jsonSchemaObject;
private static readonly _configCache;
/**
* The project folder path that was passed to {@link RigConfig.loadForProjectFolder},

@@ -122,2 +106,89 @@ * which maybe an absolute or relative path.

readonly relativeProfileFolderPath: string;
/**
* Performs Node.js module resolution to locate the rig package folder, then returns the absolute path
* of the rig profile folder specified by `rig.json`.
*
* @remarks
* If no `rig.json` file was found, then this method throws an error. The first time this method
* is called, the result is cached and will be returned by all subsequent calls.
*
* Example: `/path/to/your-project/node_modules/example-rig/profiles/example-profile`
*/
getResolvedProfileFolder(): string;
/**
* An async variant of {@link IRigConfig.getResolvedProfileFolder}
*/
getResolvedProfileFolderAsync(): Promise<string>;
/**
* This lookup first checks for the specified relative path under `projectFolderPath`; if it does
* not exist there, then it checks in the resolved rig profile folder. If the file is found,
* its absolute path is returned. Otherwise, `undefined` is returned.
*
* @remarks
* For example, suppose the rig profile is:
*
* `/path/to/your-project/node_modules/example-rig/profiles/example-profile`
*
* And suppose `configFileRelativePath` is `folder/file.json`. Then the following locations will be checked:
*
* `/path/to/your-project/folder/file.json`
*
* `/path/to/your-project/node_modules/example-rig/profiles/example-profile/folder/file.json`
*/
tryResolveConfigFilePath(configFileRelativePath: string): string | undefined;
/**
* An async variant of {@link IRigConfig.tryResolveConfigFilePath}
*/
tryResolveConfigFilePathAsync(configFileRelativePath: string): Promise<string | undefined>;
}
/**
* {@inheritdoc IRigConfig}
*
* @public
*/
export declare class RigConfig implements IRigConfig {
private static readonly _packageNameRegExp;
private static readonly _rigNameRegExp;
private static readonly _profileNameRegExp;
/**
* Returns the absolute path of the `rig.schema.json` JSON schema file for `config/rig.json`,
* which is bundled with this NPM package.
*
* @remarks
* The `RigConfig` class already performs schema validation when loading `rig.json`; however
* this schema file may be useful for integration with other validation tools.
*
* @public
*/
static jsonSchemaPath: string;
private static _jsonSchemaObject;
private static readonly _configCache;
/**
* {@inheritdoc IRigConfig.projectFolderOriginalPath}
*/
readonly projectFolderOriginalPath: string;
/**
* {@inheritdoc IRigConfig.projectFolderPath}
*/
readonly projectFolderPath: string;
/**
* {@inheritdoc IRigConfig.rigFound}
*/
readonly rigFound: boolean;
/**
* {@inheritdoc IRigConfig.filePath}
*/
readonly filePath: string;
/**
* {@inheritdoc IRigConfig.rigPackageName}
*/
readonly rigPackageName: string;
/**
* {@inheritdoc IRigConfig.rigProfile}
*/
readonly rigProfile: string;
/**
* {@inheritdoc IRigConfig.relativeProfileFolderPath}
*/
readonly relativeProfileFolderPath: string;
private _resolvedRigPackageFolder;

@@ -149,35 +220,15 @@ private _resolvedProfileFolder;

/**
* Performs Node.js module resolution to locate the rig package folder, then returns the absolute path
* of the rig profile folder specified by `rig.json`.
*
* @remarks
* If no `rig.json` file was found, then this method throws an error. The first time this method
* is called, the result is cached and will be returned by all subsequent calls.
*
* Example: `/path/to/your-project/node_modules/example-rig/profiles/example-profile`
* {@inheritdoc IRigConfig.getResolvedProfileFolder}
*/
getResolvedProfileFolder(): string;
/**
* An async variant of {@link RigConfig.getResolvedProfileFolder}
* {@inheritdoc IRigConfig.getResolvedProfileFolderAsync}
*/
getResolvedProfileFolderAsync(): Promise<string>;
/**
* This lookup first checks for the specified relative path under `projectFolderPath`; if it does
* not exist there, then it checks in the resolved rig profile folder. If the file is found,
* its absolute path is returned. Otherwise, `undefined` is returned.
*
* @remarks
* For example, suppose the rig profile is:
*
* `/path/to/your-project/node_modules/example-rig/profiles/example-profile`
*
* And suppose `configFileRelativePath` is `folder/file.json`. Then the following locations will be checked:
*
* `/path/to/your-project/folder/file.json`
*
* `/path/to/your-project/node_modules/example-rig/profiles/example-profile/folder/file.json`
* {@inheritdoc IRigConfig.tryResolveConfigFilePath}
*/
tryResolveConfigFilePath(configFileRelativePath: string): string | undefined;
/**
* An async variant of {@link RigConfig.tryResolveConfigFilePath}
* {@inheritdoc IRigConfig.tryResolveConfigFilePathAsync}
*/

@@ -184,0 +235,0 @@ tryResolveConfigFilePathAsync(configFileRelativePath: string): Promise<string | undefined>;

@@ -38,3 +38,3 @@ "use strict";

/**
* This is the main API for loading the `config/rig.json` file format.
* {@inheritdoc IRigConfig}
*

@@ -166,10 +166,3 @@ * @public

/**
* Performs Node.js module resolution to locate the rig package folder, then returns the absolute path
* of the rig profile folder specified by `rig.json`.
*
* @remarks
* If no `rig.json` file was found, then this method throws an error. The first time this method
* is called, the result is cached and will be returned by all subsequent calls.
*
* Example: `/path/to/your-project/node_modules/example-rig/profiles/example-profile`
* {@inheritdoc IRigConfig.getResolvedProfileFolder}
*/

@@ -196,3 +189,3 @@ getResolvedProfileFolder() {

/**
* An async variant of {@link RigConfig.getResolvedProfileFolder}
* {@inheritdoc IRigConfig.getResolvedProfileFolderAsync}
*/

@@ -219,16 +212,3 @@ async getResolvedProfileFolderAsync() {

/**
* This lookup first checks for the specified relative path under `projectFolderPath`; if it does
* not exist there, then it checks in the resolved rig profile folder. If the file is found,
* its absolute path is returned. Otherwise, `undefined` is returned.
*
* @remarks
* For example, suppose the rig profile is:
*
* `/path/to/your-project/node_modules/example-rig/profiles/example-profile`
*
* And suppose `configFileRelativePath` is `folder/file.json`. Then the following locations will be checked:
*
* `/path/to/your-project/folder/file.json`
*
* `/path/to/your-project/node_modules/example-rig/profiles/example-profile/folder/file.json`
* {@inheritdoc IRigConfig.tryResolveConfigFilePath}
*/

@@ -252,3 +232,3 @@ tryResolveConfigFilePath(configFileRelativePath) {

/**
* An async variant of {@link RigConfig.tryResolveConfigFilePath}
* {@inheritdoc IRigConfig.tryResolveConfigFilePathAsync}
*/

@@ -255,0 +235,0 @@ async tryResolveConfigFilePathAsync(configFileRelativePath) {

{
"name": "@rushstack/rig-package",
"version": "0.3.21",
"version": "0.4.0",
"description": "A system for sharing tool configurations between projects without duplicating config files.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc