New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@rushstack/rig-package

Package Overview
Dependencies
Maintainers
2
Versions
49
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.7
to
0.3.8
+1
-1
dist/tsdoc-metadata.json

@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.

"packageName": "@microsoft/api-extractor",
"packageVersion": "7.19.2"
"packageVersion": "7.19.4"
}
]
}

@@ -1,1 +0,1 @@

{"version":3,"file":"Helpers.js","sourceRoot":"","sources":["../src/Helpers.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,uCAAyB;AACzB,sDAAkC;AAElC,gEAAgE;AAChE,MAAa,OAAO;IAIX,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAU,EAAE,IAA2B;QAC1E,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAiC,EAAE,MAA8B,EAAE,EAAE;YAC7F,IAAA,iBAAW,EAAC,EAAE,EAAE,IAAI,EAAE,CAAC,KAAmB,EAAE,MAA0B,EAAE,EAAE;gBACxE,IAAI,KAAK,EAAE;oBACT,MAAM,CAAC,KAAK,CAAC,CAAC;iBACf;qBAAM;oBACL,OAAO,CAAC,MAAO,CAAC,CAAC;iBAClB;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,IAAiB;QACjD,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAkC,EAAE,EAAE;YAC9D,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAe,EAAE,EAAE;gBAClC,OAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,uEAAuE;IAChE,MAAM,CAAC,kBAAkB,CAAC,SAAiB;QAChD,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;YAC9B,OAAO,KAAK,CAAC;SACd;QACD,uBAAuB;QACvB,IAAI,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;YACnD,OAAO,KAAK,CAAC;SACd;QACD,OAAO,IAAI,CAAC;IACd,CAAC;;AAlCH,0BAmCC;AAlCC,uEAAuE;AACxD,+BAAuB,GAAW,0BAA0B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport * as path from 'path';\r\nimport * as fs from 'fs';\r\nimport nodeResolve from 'resolve';\r\n\r\n// These helpers avoid taking dependencies on other NPM packages\r\nexport class Helpers {\r\n // Based on Path.isDownwardRelative() from @rushstack/node-core-library\r\n private static _upwardPathSegmentRegex: RegExp = /([\\/\\\\]|^)\\.\\.([\\/\\\\]|$)/;\r\n\r\n public static async nodeResolveAsync(id: string, opts: nodeResolve.AsyncOpts): Promise<string> {\r\n return await new Promise((resolve: (result: string) => void, reject: (error: Error) => void) => {\r\n nodeResolve(id, opts, (error: Error | null, result: string | undefined) => {\r\n if (error) {\r\n reject(error);\r\n } else {\r\n resolve(result!);\r\n }\r\n });\r\n });\r\n }\r\n\r\n public static async fsExistsAsync(path: fs.PathLike): Promise<boolean> {\r\n return await new Promise((resolve: (result: boolean) => void) => {\r\n fs.exists(path, (exists: boolean) => {\r\n resolve(exists);\r\n });\r\n });\r\n }\r\n\r\n // Based on Path.isDownwardRelative() from @rushstack/node-core-library\r\n public static isDownwardRelative(inputPath: string): boolean {\r\n if (path.isAbsolute(inputPath)) {\r\n return false;\r\n }\r\n // Does it contain \"..\"\r\n if (Helpers._upwardPathSegmentRegex.test(inputPath)) {\r\n return false;\r\n }\r\n return true;\r\n }\r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,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport nodeResolve from 'resolve';\n\n// These helpers avoid taking dependencies on other NPM packages\nexport class Helpers {\n // Based on Path.isDownwardRelative() from @rushstack/node-core-library\n private static _upwardPathSegmentRegex: RegExp = /([\\/\\\\]|^)\\.\\.([\\/\\\\]|$)/;\n\n public static async nodeResolveAsync(id: string, opts: nodeResolve.AsyncOpts): Promise<string> {\n return await new Promise((resolve: (result: string) => void, reject: (error: Error) => void) => {\n nodeResolve(id, opts, (error: Error | null, result: string | undefined) => {\n if (error) {\n reject(error);\n } else {\n resolve(result!);\n }\n });\n });\n }\n\n public static async fsExistsAsync(path: fs.PathLike): Promise<boolean> {\n return await new Promise((resolve: (result: boolean) => void) => {\n fs.exists(path, (exists: boolean) => {\n resolve(exists);\n });\n });\n }\n\n // Based on Path.isDownwardRelative() from @rushstack/node-core-library\n public static isDownwardRelative(inputPath: string): boolean {\n if (path.isAbsolute(inputPath)) {\n return false;\n }\n // Does it contain \"..\"\n if (Helpers._upwardPathSegmentRegex.test(inputPath)) {\n return false;\n }\n return true;\n }\n}\n"]}

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;;;;;;GASG;AAEH,yCAAsF;AAA7D,sGAAA,SAAS,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\n/**\r\n * A system for sharing tool configurations between projects without duplicating config files.\r\n *\r\n * @remarks\r\n * The `config/rig.json` file is a system that Node.js build tools can support, in order to eliminate\r\n * duplication of config files when many projects share a common configuration. This is particularly valuable\r\n * in a setup where hundreds of projects may be built using a small set of reusable recipes.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nexport { IRigConfigJson, RigConfig, ILoadForProjectFolderOptions } from './RigConfig';\r\n"]}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;;;;;;GASG;AAEH,yCAAsF;AAA7D,sGAAA,SAAS,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * A system for sharing tool configurations between projects without duplicating config files.\n *\n * @remarks\n * The `config/rig.json` file is a system that Node.js build tools can support, in order to eliminate\n * duplication of config files when many projects share a common configuration. This is particularly valuable\n * in a setup where hundreds of projects may be built using a small set of reusable recipes.\n *\n * @packageDocumentation\n */\n\nexport { IRigConfigJson, RigConfig, ILoadForProjectFolderOptions } from './RigConfig';\n"]}

@@ -1,1 +0,1 @@

{"version":3,"file":"RigConfig.js","sourceRoot":"","sources":["../src/RigConfig.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,uCAAyB;AACzB,qDAAuC;AACvC,8EAAoD;AAEpD,uCAAoC;AA6DpC;;;;GAIG;AACH,MAAa,SAAS;IA8FpB,YAAoB,OAA0B;QAC5C,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC;QAElG,IAAI,CAAC,yBAAyB,GAAG,iBAAiB,CAAC;QACnD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAEzD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,IAAI,IAAI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b,2DAA2D,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAC9F,CAAC;SACH;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;gBACvD,MAAM,IAAI,KAAK,CACb,sFAAsF;oBACpF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAClC,CAAC;aACH;SACF;IACH,CAAC;;AAzZH,8BA0ZC;AAzZC,8EAA8E;AACtD,4BAAkB,GAAW,4CAA4C,CAAC;AAElG,iDAAiD;AACjD,gEAAgE;AACxC,wBAAc,GAAW,eAAe,CAAC;AAEjE,qEAAqE;AAC7C,4BAAkB,GAAW,iCAAiC,CAAC;AAEvF;;;;;;;;;GASG;AACW,wBAAc,GAAW,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC;AAC7E,2BAAiB,GAAuB,SAAS,CAAC;AAEzC,sBAAY,GAA2B,IAAI,GAAG,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport * as path from 'path';\r\nimport * as fs from 'fs';\r\nimport * as nodeResolve from 'resolve';\r\nimport stripJsonComments from 'strip-json-comments';\r\n\r\nimport { Helpers } from './Helpers';\r\n\r\n/**\r\n * Represents the literal contents of the `config/rig.json` file.\r\n *\r\n * @public\r\n */\r\nexport interface IRigConfigJson {\r\n /**\r\n * The name of the rig package to use.\r\n *\r\n * @remarks\r\n * The name must be a valid NPM package name, and must end with the `-rig` suffix.\r\n *\r\n * Example: `example-rig`\r\n */\r\n rigPackageName: string;\r\n\r\n /**\r\n * Specify which rig profile to use from the rig package.\r\n *\r\n * @remarks\r\n * The name must consist of lowercase alphanumeric words separated by hyphens, for example `\"sample-profile\"`.\r\n * If the `\"rigProfile\"` is not specified, then the profile name `\"default\"` will be used.\r\n *\r\n * Example: `example-profile`\r\n */\r\n rigProfile?: string;\r\n}\r\n\r\ninterface IRigConfigOptions {\r\n projectFolderPath: string;\r\n\r\n rigFound: boolean;\r\n filePath: string;\r\n rigPackageName: string;\r\n rigProfile?: string;\r\n}\r\n\r\n/**\r\n * Options for {@link RigConfig.loadForProjectFolder}.\r\n *\r\n * @public\r\n */\r\nexport interface ILoadForProjectFolderOptions {\r\n /**\r\n * The path to the folder of the project to be analyzed. This folder should contain a `package.json` file.\r\n */\r\n projectFolderPath: string;\r\n\r\n /**\r\n * If specified, instead of loading the `config/rig.json` from disk, this object will be substituted instead.\r\n */\r\n overrideRigJsonObject?: IRigConfigJson;\r\n\r\n /**\r\n * If specified, force a fresh load instead of returning a cached entry, if one existed.\r\n */\r\n bypassCache?: boolean;\r\n}\r\n\r\n/**\r\n * This is the main API for loading the `config/rig.json` file format.\r\n *\r\n * @public\r\n */\r\nexport class RigConfig {\r\n // For syntax details, see PackageNameParser from @rushstack/node-core-library\r\n private static readonly _packageNameRegExp: RegExp = /^(@[A-Za-z0-9\\-_\\.]+\\/)?[A-Za-z0-9\\-_\\.]+$/;\r\n\r\n // Rig package names must have the \"-rig\" suffix.\r\n // Also silently accept \"-rig-test\" for our build test projects.\r\n private static readonly _rigNameRegExp: RegExp = /-rig(-test)?$/;\r\n\r\n // Profiles must be lowercase alphanumeric words separated by hyphens\r\n private static readonly _profileNameRegExp: RegExp = /^[a-z0-9_\\.]+(\\-[a-z0-9_\\.]+)*$/;\r\n\r\n /**\r\n * Returns the absolute path of the `rig.schema.json` JSON schema file for `config/rig.json`,\r\n * which is bundled with this NPM package.\r\n *\r\n * @remarks\r\n * The `RigConfig` class already performs schema validation when loading `rig.json`; however\r\n * this schema file may be useful for integration with other validation tools.\r\n *\r\n * @public\r\n */\r\n public static jsonSchemaPath: string = path.resolve(__dirname, './schemas/rig.schema.json');\r\n private static _jsonSchemaObject: object | undefined = undefined;\r\n\r\n private static readonly _configCache: Map<string, RigConfig> = new Map();\r\n\r\n /**\r\n * The project folder path that was passed to {@link RigConfig.loadForProjectFolder},\r\n * which maybe an absolute or relative path.\r\n *\r\n * @remarks\r\n * Example: `.`\r\n */\r\n public readonly projectFolderOriginalPath: string;\r\n\r\n /**\r\n * The absolute path for the project folder path that was passed to {@link RigConfig.loadForProjectFolder}.\r\n *\r\n * @remarks\r\n * Example: `/path/to/your-project`\r\n */\r\n public readonly projectFolderPath: string;\r\n\r\n /**\r\n * Returns `true` if `config/rig.json` was found, or `false` otherwise.\r\n */\r\n public readonly rigFound: boolean;\r\n\r\n /**\r\n * The full path to the `rig.json` file that was found, or `\"\"` if none was found.\r\n *\r\n * @remarks\r\n * Example: `/path/to/your-project/config/rig.json`\r\n */\r\n public readonly filePath: string;\r\n\r\n /**\r\n * The `\"rigPackageName\"` field from `rig.json`, or `\"\"` if the file was not found.\r\n *\r\n * @remarks\r\n * The name must be a valid NPM package name, and must end with the `-rig` suffix.\r\n *\r\n * Example: `example-rig`\r\n */\r\n public readonly rigPackageName: string;\r\n\r\n /**\r\n * The `\"rigProfile\"` value that was loaded from `rig.json`, or `\"\"` if the file was not found.\r\n *\r\n * @remarks\r\n * The name must consist of lowercase alphanumeric words separated by hyphens, for example `\"sample-profile\"`.\r\n * If the `rig.json` file exists, but the `\"rigProfile\"` is not specified, then the profile\r\n * name will be `\"default\"`.\r\n *\r\n * Example: `example-profile`\r\n */\r\n public readonly rigProfile: string;\r\n\r\n /**\r\n * The relative path to the rig profile specified by `rig.json`, or `\"\"` if the file was not found.\r\n *\r\n * @remarks\r\n * Example: `profiles/example-profile`\r\n */\r\n public readonly relativeProfileFolderPath: string;\r\n\r\n // Example: /path/to/your-project/node_modules/example-rig/\r\n // If the value is `undefined`, then getResolvedProfileFolder() has not calculated it yet\r\n private _resolvedRigPackageFolder: string | undefined;\r\n\r\n // Example: /path/to/your-project/node_modules/example-rig/profiles/example-profile\r\n // If the value is `undefined`, then getResolvedProfileFolder() has not calculated it yet\r\n private _resolvedProfileFolder: string | undefined;\r\n\r\n private constructor(options: IRigConfigOptions) {\r\n const { projectFolderPath, rigFound, filePath, rigPackageName, rigProfile = 'default' } = options;\r\n\r\n this.projectFolderOriginalPath = projectFolderPath;\r\n this.projectFolderPath = path.resolve(projectFolderPath);\r\n\r\n this.rigFound = rigFound;\r\n this.filePath = filePath;\r\n this.rigPackageName = rigPackageName;\r\n this.rigProfile = rigProfile;\r\n\r\n if (this.rigFound) {\r\n this.relativeProfileFolderPath = 'profiles/' + this.rigProfile;\r\n } else {\r\n this.relativeProfileFolderPath = '';\r\n }\r\n }\r\n\r\n /**\r\n * The JSON contents of the {@link RigConfig.jsonSchemaPath} file.\r\n *\r\n * @remarks\r\n * The JSON object will be lazily loaded when this property getter is accessed, and the result\r\n * will be cached.\r\n * Accessing this property may make a synchronous filesystem call.\r\n */\r\n public static get jsonSchemaObject(): object {\r\n if (RigConfig._jsonSchemaObject === undefined) {\r\n const jsonSchemaContent: string = fs.readFileSync(RigConfig.jsonSchemaPath).toString();\r\n RigConfig._jsonSchemaObject = JSON.parse(jsonSchemaContent);\r\n }\r\n return RigConfig._jsonSchemaObject!;\r\n }\r\n\r\n /**\r\n * Use this method to load the `config/rig.json` file for a given project.\r\n *\r\n * @remarks\r\n * If the file cannot be found, an empty `RigConfig` object will be returned with {@link RigConfig.rigFound}\r\n * equal to `false`.\r\n */\r\n public static loadForProjectFolder(options: ILoadForProjectFolderOptions): RigConfig {\r\n const { overrideRigJsonObject, projectFolderPath } = options;\r\n\r\n const fromCache: RigConfig | undefined =\r\n !options.bypassCache && !overrideRigJsonObject\r\n ? RigConfig._configCache.get(projectFolderPath)\r\n : undefined;\r\n\r\n if (fromCache) {\r\n return fromCache;\r\n }\r\n\r\n const rigConfigFilePath: string = path.join(projectFolderPath, 'config/rig.json');\r\n\r\n let config: RigConfig | undefined;\r\n let json: IRigConfigJson | undefined = overrideRigJsonObject;\r\n try {\r\n if (!json) {\r\n const rigConfigFileContent: string = fs.readFileSync(rigConfigFilePath).toString();\r\n json = JSON.parse(stripJsonComments(rigConfigFileContent)) as IRigConfigJson;\r\n }\r\n RigConfig._validateSchema(json);\r\n } catch (error) {\r\n config = RigConfig._handleConfigError(error as Error, projectFolderPath, rigConfigFilePath);\r\n }\r\n\r\n if (!config) {\r\n config = new RigConfig({\r\n projectFolderPath: projectFolderPath,\r\n\r\n rigFound: true,\r\n filePath: rigConfigFilePath,\r\n rigPackageName: json!.rigPackageName,\r\n rigProfile: json!.rigProfile\r\n });\r\n }\r\n\r\n if (!overrideRigJsonObject) {\r\n RigConfig._configCache.set(projectFolderPath, config);\r\n }\r\n return config;\r\n }\r\n\r\n /**\r\n * An async variant of {@link RigConfig.loadForProjectFolder}\r\n */\r\n public static async loadForProjectFolderAsync(options: ILoadForProjectFolderOptions): Promise<RigConfig> {\r\n const { overrideRigJsonObject, projectFolderPath } = options;\r\n\r\n const fromCache: RigConfig | false | undefined =\r\n !options.bypassCache && !overrideRigJsonObject && RigConfig._configCache.get(projectFolderPath);\r\n\r\n if (fromCache) {\r\n return fromCache;\r\n }\r\n\r\n const rigConfigFilePath: string = path.join(projectFolderPath, 'config/rig.json');\r\n\r\n let config: RigConfig | undefined;\r\n let json: IRigConfigJson | undefined = overrideRigJsonObject;\r\n try {\r\n if (!json) {\r\n const rigConfigFileContent: string = (await fs.promises.readFile(rigConfigFilePath)).toString();\r\n json = JSON.parse(stripJsonComments(rigConfigFileContent)) as IRigConfigJson;\r\n }\r\n\r\n RigConfig._validateSchema(json);\r\n } catch (error) {\r\n config = RigConfig._handleConfigError(error as Error, projectFolderPath, rigConfigFilePath);\r\n }\r\n\r\n if (!config) {\r\n config = new RigConfig({\r\n projectFolderPath: projectFolderPath,\r\n\r\n rigFound: true,\r\n filePath: rigConfigFilePath,\r\n rigPackageName: json!.rigPackageName,\r\n rigProfile: json!.rigProfile\r\n });\r\n }\r\n\r\n if (!overrideRigJsonObject) {\r\n RigConfig._configCache.set(projectFolderPath, config);\r\n }\r\n return config;\r\n }\r\n\r\n private static _handleConfigError(\r\n error: NodeJS.ErrnoException,\r\n projectFolderPath: string,\r\n rigConfigFilePath: string\r\n ): RigConfig {\r\n if (error.code !== 'ENOENT' && error.code !== 'ENOTDIR') {\r\n throw new Error(error.message + '\\nError loading config file: ' + rigConfigFilePath);\r\n }\r\n\r\n // File not found, i.e. no rig config\r\n return new RigConfig({\r\n projectFolderPath,\r\n\r\n rigFound: false,\r\n filePath: '',\r\n rigPackageName: '',\r\n rigProfile: ''\r\n });\r\n }\r\n\r\n /**\r\n * Performs Node.js module resolution to locate the rig package folder, then returns the absolute path\r\n * of the rig profile folder specified by `rig.json`.\r\n *\r\n * @remarks\r\n * If no `rig.json` file was found, then this method throws an error. The first time this method\r\n * is called, the result is cached and will be returned by all subsequent calls.\r\n *\r\n * Example: `/path/to/your-project/node_modules/example-rig/profiles/example-profile`\r\n */\r\n public getResolvedProfileFolder(): string {\r\n if (this._resolvedRigPackageFolder === undefined) {\r\n if (!this.rigFound) {\r\n throw new Error('Cannot resolve the rig package because no rig was specified for this project');\r\n }\r\n\r\n const rigPackageJsonModuleSpecifier: string = `${this.rigPackageName}/package.json`;\r\n const resolveOptions: nodeResolve.Opts = { basedir: this.projectFolderPath };\r\n const resolvedRigPackageJsonPath: string = nodeResolve.sync(\r\n rigPackageJsonModuleSpecifier,\r\n resolveOptions\r\n );\r\n\r\n this._resolvedRigPackageFolder = path.dirname(resolvedRigPackageJsonPath);\r\n }\r\n\r\n if (this._resolvedProfileFolder === undefined) {\r\n this._resolvedProfileFolder = path.join(this._resolvedRigPackageFolder, this.relativeProfileFolderPath);\r\n\r\n if (!fs.existsSync(this._resolvedProfileFolder)) {\r\n throw new Error(\r\n `The rig profile \"${this.rigProfile}\" is not defined` +\r\n ` by the rig package \"${this.rigPackageName}\"`\r\n );\r\n }\r\n }\r\n\r\n return this._resolvedProfileFolder;\r\n }\r\n\r\n /**\r\n * An async variant of {@link RigConfig.getResolvedProfileFolder}\r\n */\r\n public async getResolvedProfileFolderAsync(): Promise<string> {\r\n if (this._resolvedRigPackageFolder === undefined) {\r\n if (!this.rigFound) {\r\n throw new Error('Cannot resolve the rig package because no rig was specified for this project');\r\n }\r\n\r\n const rigPackageJsonModuleSpecifier: string = `${this.rigPackageName}/package.json`;\r\n const resolveOptions: nodeResolve.Opts = { basedir: this.projectFolderPath };\r\n const resolvedRigPackageJsonPath: string = await Helpers.nodeResolveAsync(\r\n rigPackageJsonModuleSpecifier,\r\n resolveOptions\r\n );\r\n\r\n this._resolvedRigPackageFolder = path.dirname(resolvedRigPackageJsonPath);\r\n }\r\n\r\n if (this._resolvedProfileFolder === undefined) {\r\n this._resolvedProfileFolder = path.join(this._resolvedRigPackageFolder, this.relativeProfileFolderPath);\r\n\r\n if (!(await Helpers.fsExistsAsync(this._resolvedProfileFolder))) {\r\n throw new Error(\r\n `The rig profile \"${this.rigProfile}\" is not defined` +\r\n ` by the rig package \"${this.rigPackageName}\"`\r\n );\r\n }\r\n }\r\n\r\n return this._resolvedProfileFolder;\r\n }\r\n\r\n /**\r\n * This lookup first checks for the specified relative path under `projectFolderPath`; if it does\r\n * not exist there, then it checks in the resolved rig profile folder. If the file is found,\r\n * its absolute path is returned. Otherwise, `undefined` is returned.\r\n *\r\n * @remarks\r\n * For example, suppose the rig profile is:\r\n *\r\n * `/path/to/your-project/node_modules/example-rig/profiles/example-profile`\r\n *\r\n * And suppose `configFileRelativePath` is `folder/file.json`. Then the following locations will be checked:\r\n *\r\n * `/path/to/your-project/folder/file.json`\r\n *\r\n * `/path/to/your-project/node_modules/example-rig/profiles/example-profile/folder/file.json`\r\n */\r\n public tryResolveConfigFilePath(configFileRelativePath: string): string | undefined {\r\n if (!Helpers.isDownwardRelative(configFileRelativePath)) {\r\n throw new Error('The configFileRelativePath is not a relative path: ' + configFileRelativePath);\r\n }\r\n\r\n const localPath: string = path.join(this.projectFolderPath, configFileRelativePath);\r\n if (fs.existsSync(localPath)) {\r\n return localPath;\r\n }\r\n if (this.rigFound) {\r\n const riggedPath: string = path.join(this.getResolvedProfileFolder(), configFileRelativePath);\r\n if (fs.existsSync(riggedPath)) {\r\n return riggedPath;\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * An async variant of {@link RigConfig.tryResolveConfigFilePath}\r\n */\r\n public async tryResolveConfigFilePathAsync(configFileRelativePath: string): Promise<string | undefined> {\r\n if (!Helpers.isDownwardRelative(configFileRelativePath)) {\r\n throw new Error('The configFileRelativePath is not a relative path: ' + configFileRelativePath);\r\n }\r\n\r\n const localPath: string = path.join(this.projectFolderPath, configFileRelativePath);\r\n if (await Helpers.fsExistsAsync(localPath)) {\r\n return localPath;\r\n }\r\n if (this.rigFound) {\r\n const riggedPath: string = path.join(\r\n await this.getResolvedProfileFolderAsync(),\r\n configFileRelativePath\r\n );\r\n if (await Helpers.fsExistsAsync(riggedPath)) {\r\n return riggedPath;\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n private static _validateSchema(json: IRigConfigJson): void {\r\n for (const key of Object.getOwnPropertyNames(json)) {\r\n switch (key) {\r\n case '$schema':\r\n case 'rigPackageName':\r\n case 'rigProfile':\r\n break;\r\n default:\r\n throw new Error(`Unsupported field ${JSON.stringify(key)}`);\r\n }\r\n }\r\n if (!json.rigPackageName) {\r\n throw new Error('Missing required field \"rigPackageName\"');\r\n }\r\n\r\n if (!RigConfig._packageNameRegExp.test(json.rigPackageName)) {\r\n throw new Error(\r\n `The \"rigPackageName\" value is not a valid NPM package name: ${JSON.stringify(json.rigPackageName)}`\r\n );\r\n }\r\n\r\n if (!RigConfig._rigNameRegExp.test(json.rigPackageName)) {\r\n throw new Error(\r\n `The \"rigPackageName\" value is missing the \"-rig\" suffix: ` + JSON.stringify(json.rigProfile)\r\n );\r\n }\r\n\r\n if (json.rigProfile !== undefined) {\r\n if (!RigConfig._profileNameRegExp.test(json.rigProfile)) {\r\n throw new Error(\r\n `The profile name must consist of lowercase alphanumeric words separated by hyphens: ` +\r\n JS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;AAC7C,4BAAkB,GAAW,iCAAiC,CAAC;AAEvF;;;;;;;;;GASG;AACW,wBAAc,GAAW,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC;AAC7E,2BAAiB,GAAuB,SAAS,CAAC;AAEzC,sBAAY,GAA2B,IAAI,GAAG,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport * as nodeResolve from 'resolve';\nimport stripJsonComments from 'strip-json-comments';\n\nimport { Helpers } from './Helpers';\n\n/**\n * Represents the literal contents of the `config/rig.json` file.\n *\n * @public\n */\nexport interface IRigConfigJson {\n /**\n * The name of the rig package to use.\n *\n * @remarks\n * The name must be a valid NPM package name, and must end with the `-rig` suffix.\n *\n * Example: `example-rig`\n */\n rigPackageName: string;\n\n /**\n * Specify which rig profile to use from the rig package.\n *\n * @remarks\n * The name must consist of lowercase alphanumeric words separated by hyphens, for example `\"sample-profile\"`.\n * If the `\"rigProfile\"` is not specified, then the profile name `\"default\"` will be used.\n *\n * Example: `example-profile`\n */\n rigProfile?: string;\n}\n\ninterface IRigConfigOptions {\n projectFolderPath: string;\n\n rigFound: boolean;\n filePath: string;\n rigPackageName: string;\n rigProfile?: string;\n}\n\n/**\n * Options for {@link RigConfig.loadForProjectFolder}.\n *\n * @public\n */\nexport interface ILoadForProjectFolderOptions {\n /**\n * The path to the folder of the project to be analyzed. This folder should contain a `package.json` file.\n */\n projectFolderPath: string;\n\n /**\n * If specified, instead of loading the `config/rig.json` from disk, this object will be substituted instead.\n */\n overrideRigJsonObject?: IRigConfigJson;\n\n /**\n * If specified, force a fresh load instead of returning a cached entry, if one existed.\n */\n bypassCache?: boolean;\n}\n\n/**\n * This is the main API for loading the `config/rig.json` file format.\n *\n * @public\n */\nexport class RigConfig {\n // For syntax details, see PackageNameParser from @rushstack/node-core-library\n private static readonly _packageNameRegExp: RegExp = /^(@[A-Za-z0-9\\-_\\.]+\\/)?[A-Za-z0-9\\-_\\.]+$/;\n\n // Rig package names must have the \"-rig\" suffix.\n // Also silently accept \"-rig-test\" for our build test projects.\n private static readonly _rigNameRegExp: RegExp = /-rig(-test)?$/;\n\n // Profiles must be lowercase alphanumeric words separated by hyphens\n private static readonly _profileNameRegExp: RegExp = /^[a-z0-9_\\.]+(\\-[a-z0-9_\\.]+)*$/;\n\n /**\n * Returns the absolute path of the `rig.schema.json` JSON schema file for `config/rig.json`,\n * which is bundled with this NPM package.\n *\n * @remarks\n * The `RigConfig` class already performs schema validation when loading `rig.json`; however\n * this schema file may be useful for integration with other validation tools.\n *\n * @public\n */\n public static jsonSchemaPath: string = path.resolve(__dirname, './schemas/rig.schema.json');\n private static _jsonSchemaObject: object | undefined = undefined;\n\n private static readonly _configCache: Map<string, RigConfig> = new Map();\n\n /**\n * The project folder path that was passed to {@link RigConfig.loadForProjectFolder},\n * which maybe an absolute or relative path.\n *\n * @remarks\n * Example: `.`\n */\n public readonly projectFolderOriginalPath: string;\n\n /**\n * The absolute path for the project folder path that was passed to {@link RigConfig.loadForProjectFolder}.\n *\n * @remarks\n * Example: `/path/to/your-project`\n */\n public readonly projectFolderPath: string;\n\n /**\n * Returns `true` if `config/rig.json` was found, or `false` otherwise.\n */\n public readonly rigFound: boolean;\n\n /**\n * The full path to the `rig.json` file that was found, or `\"\"` if none was found.\n *\n * @remarks\n * Example: `/path/to/your-project/config/rig.json`\n */\n public readonly filePath: string;\n\n /**\n * The `\"rigPackageName\"` field from `rig.json`, or `\"\"` if the file was not found.\n *\n * @remarks\n * The name must be a valid NPM package name, and must end with the `-rig` suffix.\n *\n * Example: `example-rig`\n */\n public readonly rigPackageName: string;\n\n /**\n * The `\"rigProfile\"` value that was loaded from `rig.json`, or `\"\"` if the file was not found.\n *\n * @remarks\n * The name must consist of lowercase alphanumeric words separated by hyphens, for example `\"sample-profile\"`.\n * If the `rig.json` file exists, but the `\"rigProfile\"` is not specified, then the profile\n * name will be `\"default\"`.\n *\n * Example: `example-profile`\n */\n public readonly rigProfile: string;\n\n /**\n * The relative path to the rig profile specified by `rig.json`, or `\"\"` if the file was not found.\n *\n * @remarks\n * Example: `profiles/example-profile`\n */\n public readonly relativeProfileFolderPath: string;\n\n // Example: /path/to/your-project/node_modules/example-rig/\n // If the value is `undefined`, then getResolvedProfileFolder() has not calculated it yet\n private _resolvedRigPackageFolder: string | undefined;\n\n // Example: /path/to/your-project/node_modules/example-rig/profiles/example-profile\n // If the value is `undefined`, then getResolvedProfileFolder() has not calculated it yet\n private _resolvedProfileFolder: string | undefined;\n\n private constructor(options: IRigConfigOptions) {\n const { projectFolderPath, rigFound, filePath, rigPackageName, rigProfile = 'default' } = options;\n\n this.projectFolderOriginalPath = projectFolderPath;\n this.projectFolderPath = path.resolve(projectFolderPath);\n\n this.rigFound = rigFound;\n this.filePath = filePath;\n this.rigPackageName = rigPackageName;\n this.rigProfile = rigProfile;\n\n if (this.rigFound) {\n this.relativeProfileFolderPath = 'profiles/' + this.rigProfile;\n } else {\n this.relativeProfileFolderPath = '';\n }\n }\n\n /**\n * The JSON contents of the {@link RigConfig.jsonSchemaPath} file.\n *\n * @remarks\n * The JSON object will be lazily loaded when this property getter is accessed, and the result\n * will be cached.\n * Accessing this property may make a synchronous filesystem call.\n */\n public static get jsonSchemaObject(): object {\n if (RigConfig._jsonSchemaObject === undefined) {\n const jsonSchemaContent: string = fs.readFileSync(RigConfig.jsonSchemaPath).toString();\n RigConfig._jsonSchemaObject = JSON.parse(jsonSchemaContent);\n }\n return RigConfig._jsonSchemaObject!;\n }\n\n /**\n * Use this method to load the `config/rig.json` file for a given project.\n *\n * @remarks\n * If the file cannot be found, an empty `RigConfig` object will be returned with {@link RigConfig.rigFound}\n * equal to `false`.\n */\n public static loadForProjectFolder(options: ILoadForProjectFolderOptions): RigConfig {\n const { overrideRigJsonObject, projectFolderPath } = options;\n\n const fromCache: RigConfig | undefined =\n !options.bypassCache && !overrideRigJsonObject\n ? RigConfig._configCache.get(projectFolderPath)\n : undefined;\n\n if (fromCache) {\n return fromCache;\n }\n\n const rigConfigFilePath: string = path.join(projectFolderPath, 'config/rig.json');\n\n let config: RigConfig | undefined;\n let json: IRigConfigJson | undefined = overrideRigJsonObject;\n try {\n if (!json) {\n const rigConfigFileContent: string = fs.readFileSync(rigConfigFilePath).toString();\n json = JSON.parse(stripJsonComments(rigConfigFileContent)) as IRigConfigJson;\n }\n RigConfig._validateSchema(json);\n } catch (error) {\n config = RigConfig._handleConfigError(error as Error, projectFolderPath, rigConfigFilePath);\n }\n\n if (!config) {\n config = new RigConfig({\n projectFolderPath: projectFolderPath,\n\n rigFound: true,\n filePath: rigConfigFilePath,\n rigPackageName: json!.rigPackageName,\n rigProfile: json!.rigProfile\n });\n }\n\n if (!overrideRigJsonObject) {\n RigConfig._configCache.set(projectFolderPath, config);\n }\n return config;\n }\n\n /**\n * An async variant of {@link RigConfig.loadForProjectFolder}\n */\n public static async loadForProjectFolderAsync(options: ILoadForProjectFolderOptions): Promise<RigConfig> {\n const { overrideRigJsonObject, projectFolderPath } = options;\n\n const fromCache: RigConfig | false | undefined =\n !options.bypassCache && !overrideRigJsonObject && RigConfig._configCache.get(projectFolderPath);\n\n if (fromCache) {\n return fromCache;\n }\n\n const rigConfigFilePath: string = path.join(projectFolderPath, 'config/rig.json');\n\n let config: RigConfig | undefined;\n let json: IRigConfigJson | undefined = overrideRigJsonObject;\n try {\n if (!json) {\n const rigConfigFileContent: string = (await fs.promises.readFile(rigConfigFilePath)).toString();\n json = JSON.parse(stripJsonComments(rigConfigFileContent)) as IRigConfigJson;\n }\n\n RigConfig._validateSchema(json);\n } catch (error) {\n config = RigConfig._handleConfigError(error as Error, projectFolderPath, rigConfigFilePath);\n }\n\n if (!config) {\n config = new RigConfig({\n projectFolderPath: projectFolderPath,\n\n rigFound: true,\n filePath: rigConfigFilePath,\n rigPackageName: json!.rigPackageName,\n rigProfile: json!.rigProfile\n });\n }\n\n if (!overrideRigJsonObject) {\n RigConfig._configCache.set(projectFolderPath, config);\n }\n return config;\n }\n\n private static _handleConfigError(\n error: NodeJS.ErrnoException,\n projectFolderPath: string,\n rigConfigFilePath: string\n ): RigConfig {\n if (error.code !== 'ENOENT' && error.code !== 'ENOTDIR') {\n throw new Error(error.message + '\\nError loading config file: ' + rigConfigFilePath);\n }\n\n // File not found, i.e. no rig config\n return new RigConfig({\n projectFolderPath,\n\n rigFound: false,\n filePath: '',\n rigPackageName: '',\n rigProfile: ''\n });\n }\n\n /**\n * Performs Node.js module resolution to locate the rig package folder, then returns the absolute path\n * of the rig profile folder specified by `rig.json`.\n *\n * @remarks\n * If no `rig.json` file was found, then this method throws an error. The first time this method\n * is called, the result is cached and will be returned by all subsequent calls.\n *\n * Example: `/path/to/your-project/node_modules/example-rig/profiles/example-profile`\n */\n public getResolvedProfileFolder(): string {\n if (this._resolvedRigPackageFolder === undefined) {\n if (!this.rigFound) {\n throw new Error('Cannot resolve the rig package because no rig was specified for this project');\n }\n\n const rigPackageJsonModuleSpecifier: string = `${this.rigPackageName}/package.json`;\n const resolveOptions: nodeResolve.Opts = { basedir: this.projectFolderPath };\n const resolvedRigPackageJsonPath: string = nodeResolve.sync(\n rigPackageJsonModuleSpecifier,\n resolveOptions\n );\n\n this._resolvedRigPackageFolder = path.dirname(resolvedRigPackageJsonPath);\n }\n\n if (this._resolvedProfileFolder === undefined) {\n this._resolvedProfileFolder = path.join(this._resolvedRigPackageFolder, this.relativeProfileFolderPath);\n\n if (!fs.existsSync(this._resolvedProfileFolder)) {\n throw new Error(\n `The rig profile \"${this.rigProfile}\" is not defined` +\n ` by the rig package \"${this.rigPackageName}\"`\n );\n }\n }\n\n return this._resolvedProfileFolder;\n }\n\n /**\n * An async variant of {@link RigConfig.getResolvedProfileFolder}\n */\n public async getResolvedProfileFolderAsync(): Promise<string> {\n if (this._resolvedRigPackageFolder === undefined) {\n if (!this.rigFound) {\n throw new Error('Cannot resolve the rig package because no rig was specified for this project');\n }\n\n const rigPackageJsonModuleSpecifier: string = `${this.rigPackageName}/package.json`;\n const resolveOptions: nodeResolve.Opts = { basedir: this.projectFolderPath };\n const resolvedRigPackageJsonPath: string = await Helpers.nodeResolveAsync(\n rigPackageJsonModuleSpecifier,\n resolveOptions\n );\n\n this._resolvedRigPackageFolder = path.dirname(resolvedRigPackageJsonPath);\n }\n\n if (this._resolvedProfileFolder === undefined) {\n this._resolvedProfileFolder = path.join(this._resolvedRigPackageFolder, this.relativeProfileFolderPath);\n\n if (!(await Helpers.fsExistsAsync(this._resolvedProfileFolder))) {\n throw new Error(\n `The rig profile \"${this.rigProfile}\" is not defined` +\n ` by the rig package \"${this.rigPackageName}\"`\n );\n }\n }\n\n return this._resolvedProfileFolder;\n }\n\n /**\n * This lookup first checks for the specified relative path under `projectFolderPath`; if it does\n * not exist there, then it checks in the resolved rig profile folder. If the file is found,\n * its absolute path is returned. Otherwise, `undefined` is returned.\n *\n * @remarks\n * For example, suppose the rig profile is:\n *\n * `/path/to/your-project/node_modules/example-rig/profiles/example-profile`\n *\n * And suppose `configFileRelativePath` is `folder/file.json`. Then the following locations will be checked:\n *\n * `/path/to/your-project/folder/file.json`\n *\n * `/path/to/your-project/node_modules/example-rig/profiles/example-profile/folder/file.json`\n */\n public tryResolveConfigFilePath(configFileRelativePath: string): string | undefined {\n if (!Helpers.isDownwardRelative(configFileRelativePath)) {\n throw new Error('The configFileRelativePath is not a relative path: ' + configFileRelativePath);\n }\n\n const localPath: string = path.join(this.projectFolderPath, configFileRelativePath);\n if (fs.existsSync(localPath)) {\n return localPath;\n }\n if (this.rigFound) {\n const riggedPath: string = path.join(this.getResolvedProfileFolder(), configFileRelativePath);\n if (fs.existsSync(riggedPath)) {\n return riggedPath;\n }\n }\n return undefined;\n }\n\n /**\n * An async variant of {@link RigConfig.tryResolveConfigFilePath}\n */\n public async tryResolveConfigFilePathAsync(configFileRelativePath: string): Promise<string | undefined> {\n if (!Helpers.isDownwardRelative(configFileRelativePath)) {\n throw new Error('The configFileRelativePath is not a relative path: ' + configFileRelativePath);\n }\n\n const localPath: string = path.join(this.projectFolderPath, configFileRelativePath);\n if (await Helpers.fsExistsAsync(localPath)) {\n return localPath;\n }\n if (this.rigFound) {\n const riggedPath: string = path.join(\n await this.getResolvedProfileFolderAsync(),\n configFileRelativePath\n );\n if (await Helpers.fsExistsAsync(riggedPath)) {\n return riggedPath;\n }\n }\n return undefined;\n }\n\n private static _validateSchema(json: IRigConfigJson): void {\n for (const key of Object.getOwnPropertyNames(json)) {\n switch (key) {\n case '$schema':\n case 'rigPackageName':\n case 'rigProfile':\n break;\n default:\n throw new Error(`Unsupported field ${JSON.stringify(key)}`);\n }\n }\n if (!json.rigPackageName) {\n throw new Error('Missing required field \"rigPackageName\"');\n }\n\n if (!RigConfig._packageNameRegExp.test(json.rigPackageName)) {\n throw new Error(\n `The \"rigPackageName\" value is not a valid NPM package name: ${JSON.stringify(json.rigPackageName)}`\n );\n }\n\n if (!RigConfig._rigNameRegExp.test(json.rigPackageName)) {\n throw new Error(\n `The \"rigPackageName\" value is missing the \"-rig\" suffix: ` + JSON.stringify(json.rigProfile)\n );\n }\n\n if (json.rigProfile !== undefined) {\n if (!RigConfig._profileNameRegExp.test(json.rigProfile)) {\n throw new Error(\n `The profile name must consist of lowercase alphanumeric words separated by hyphens: ` +\n JSON.stringify(json.rigProfile)\n );\n }\n }\n }\n}\n"]}

@@ -0,0 +0,0 @@ {

{
"name": "@rushstack/rig-package",
"version": "0.3.7",
"description": "A system for sharing tool configurations between projects without duplicating config files.",
"main": "lib/index.js",
"typings": "dist/rig-package.d.ts",
"license": "MIT",
"repository": {
"url": "https://github.com/microsoft/rushstack.git",
"type": "git",
"directory": "libraries/rig-package"
},
"dependencies": {
"resolve": "~1.17.0",
"strip-json-comments": "~3.1.1"
},
"devDependencies": {
"@rushstack/eslint-config": "2.5.1",
"@rushstack/heft-node-rig": "1.4.3",
"@rushstack/heft": "0.43.2",
"@types/heft-jest": "1.0.1",
"@types/node": "12.20.24",
"@types/resolve": "1.17.1",
"ajv": "~6.12.5",
"resolve": "~1.17.0"
},
"scripts": {
"build": "heft test --clean"
}
}
"name": "@rushstack/rig-package",
"version": "0.3.8",
"description": "A system for sharing tool configurations between projects without duplicating config files.",
"main": "lib/index.js",
"typings": "dist/rig-package.d.ts",
"license": "MIT",
"repository": {
"url": "https://github.com/microsoft/rushstack.git",
"type": "git",
"directory": "libraries/rig-package"
},
"dependencies": {
"resolve": "~1.17.0",
"strip-json-comments": "~3.1.1"
},
"devDependencies": {
"@rushstack/eslint-config": "2.5.2",
"@rushstack/heft-node-rig": "1.7.1",
"@rushstack/heft": "0.44.2",
"@types/heft-jest": "1.0.1",
"@types/node": "12.20.24",
"@types/resolve": "1.17.1",
"ajv": "~6.12.5",
"resolve": "~1.17.0"
},
"scripts": {
"build": "heft build --clean",
"_phase:build": "heft build --clean",
"_phase:test": "heft test --no-build"
},
"readme": "# @rushstack/rig-package\n\nThe **config/rig.json** file is a system that Node.js build tools can adopt, in order to eliminate\nduplication of config files when many projects share a common configuration. This is particularly valuable\nin a setup where hundreds of projects may be built using a small set of reusable recipes.\n\n## Motivation\n\nFor a concrete example, consider the [API Extractor](https://api-extractor.com/) tool which reads its\nconfiguration from **\\<projectFolder\\>/config/api-extractor.json**. Suppose that we have three separate projects\nthat all share the exact same configuration:\n\n```\nproject1/package.json\nproject1/config/api-extractor.json\nproject1/config/other-tool2.json\nproject1/config/other-tool3.json\nproject1/src/index.ts\n\nproject2/package.json\nproject2/config/api-extractor.json\nproject2/config/other-tool2.json\nproject2/config/other-tool3.json\nproject2/src/index.ts\n\nproject3/package.json\nproject3/config/api-extractor.json\nproject3/config/other-tool2.json\nproject3/config/other-tool3.json\nproject3/src/index.ts\n```\n\nIt seems wasteful to copy and paste the **api-extractor.json** file with all those settings. If we later need\nto tune the configuration, we'd have to find and update each file. For a large organization, there could be\nhundreds of such projects.\n\nThe `\"extends\"` setting provides a basic way to centralize the configuration in a \"rig package\". For this example,\nwe'll call our NPM package **example-rig**:\n\n```\nexample-rig/package.json\nexample-rig/profile/node-library/config/api-extractor.json\nexample-rig/profile/web-library/config/api-extractor.json\n\nproject1/package.json\nproject1/config/api-extractor.json\nproject1/config/other-tool2.json\nproject1/config/other-tool3.json\nproject1/src/index.ts\n\nproject2/package.json\nproject2/config/api-extractor.json\nproject2/config/other-tool2.json\nproject2/config/other-tool3.json\nproject2/src/index.ts\n\nproject3/package.json\nproject3/config/api-extractor.json\nproject3/config/other-tool2.json\nproject3/config/other-tool3.json\nproject3/src/index.ts\n```\n\nTo make things interesting, above we've introduced two \"profiles\":\n\n- `node-library` is for libraries that target the Node.js runtime\n- `web-library` is for libraries that target a web browser\n\n> **NOTE:** The `node-library` and `web-library` names are hypothetical examples. The names and purposes of\n> rig profiles are user-defined. If you only need one profile, then call it `default`.\n\nIf **project1** and **project2** are Node.js libraries, then their **api-extractor.json** now reduces to this:\n\n**project1/config/api-extractor.json**\n\n```js\n{\n \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n \"extends\": \"example-rig/profile/node-library/config/api-extractor.json\"\n}\n```\n\nWhereas if **project3** is a web browser library, then it might look like this:\n\n**project3/config/api-extractor.json**\n\n```js\n{\n \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n \"extends\": \"example-rig/profile/web-library/config/api-extractor.json\"\n}\n```\n\nUsing `\"extends\"` definitely made the config file shorter! But imagine that we have a large monorepo with 100 projects.\nAnd each project has 5 config files like **api-extactor.json**. We still have to copy+paste 100 x 5 = 500 config files\nacross all our project folders.\n\nCan we do better?\n\n## rig.json eliminates files entirely\n\nThe idea is to replace `config/api-extractor.json` and `config/other-tool2.json` (and any other such files)\nwith a single file `config/rig.json` that delegates everything to the rig package:\n\n**project3/config/rig.json**\n\n```js\n{\n \"$schema\": \"https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json\",\n\n /**\n * (Required) The name of the rig package to inherit from.\n * It should be an NPM package name with the \"-rig\" suffix.\n */\n \"rigPackageName\": \"example-rig\",\n\n /**\n * (Optional) Selects a config profile from the rig package. The name must consist of\n * lowercase alphanumeric words separated by hyphens, for example \"sample-profile\".\n * If omitted, then the \"default\" profile will be used.\"\n */\n \"rigProfile\": \"web-library\"\n}\n```\n\nUsing **rig.json** eliminates the `\"extends\"` stub files entirely. A tool that implements the **rig.json** system\nwould probe for its config file (`<targetFile>.json`) using the following procedure:\n\n1. First check for `config/<targetFile>.json` in the project folder; if found, use that file. OTHERWISE...\n2. Check for `config/rig.json`; if found, then this project is using a rig package. Read the `<rigPackageName>`\n and `<rigProfile>` settings from that file.\n3. Use Node.js module resolution to find the `<rigPackageName>` package folder (let's call that `<rigPackageFolder>`)\n4. Check for `<rigPackageFolder>/profile/<rigProfile>/<targetFile>.json`; if found, use that file. OTHERWISE...\n5. If the `<targetFile>.json` cannot be found in either of these places, the behavior is left to the tool.\n For example, it could report an error, or proceed using defaults.\n\nIn cases where we need a project-specific customization, the `\"extends\"` field is still supported. For example,\n**project1** can still add a local override like this:\n\n**project1/config/api-extractor.json**\n\n```js\n{\n \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n \"extends\": \"example-rig/profile/node-library/config/api-extractor.json\",\n\n // Local override:\n \"mainEntryPointFilePath\": \"<projectFolder>/lib/custom.d.ts\",\n}\n```\n\nThe result is a much shorter inventory of files:\n\n```\nexample-rig/package.json\n\nexample-rig/profile/node-library/config/api-extractor.json\nexample-rig/profile/node-library/config/other-tool2.json\nexample-rig/profile/node-library/config/other-tool3.json\n\nexample-rig/profile/web-library/config/api-extractor.json\nexample-rig/profile/web-library/config/other-tool2.json\nexample-rig/profile/web-library/config/other-tool3.json\n\nproject1/package.json\nproject1/config/rig.json\nproject1/config/api-extractor.json <-- local override shown above\nproject1/src/index.ts\n\nproject2/package.json\nproject2/config/rig.json\nproject2/src/index.ts\n\nproject3/package.json\nproject3/config/rig.json\nproject3/src/index.ts\n```\n\n## The `@rushstack/rig-package` API\n\nThe `@rushstack/rig-package` library provides an API for loading the **rig.json** file and performing lookups.\nIt is a lightweight NPM package, intended to be easy for tool projects to accept as a dependency. The package\nalso includes the JSON schema file **rig.schema.json**.\n\nExample usage of the API:\n\n```ts\nimport { RigConfig } from '@rushstack/rig-package';\n\n// Probe for the rig.json file and load it if found\nconst rigConfig: RigConfig = RigConfig.loadForProjectFolder({\n // Specify a project folder (i.e. where its package.json file is located)\n projectFolderPath: testProjectFolder\n});\n\nif (rigConfig.rigFound) {\n // We found a config/rig.json file\n //\n // Prints \"/path/to/project3/config/rig.json\"\n console.log('Found rig.json: ' + rigConfig.filePath);\n\n // Prints \"example-rig\"\n console.log('The rig package is: ' + rigConfig.rigPackageName);\n\n // Resolve the rig package\n //\n // Prints \"/path/to/project3/node_modules/example-rig/profile/web-library\"\n console.log('Profile folder: ' + rigConfig.getResolvedProfileFolder());\n\n // Look up a config file. These file paths will be tested:\n //\n // /path/to/project3/folder/file.json\n // /path/to/project3/node_modules/example-rig/profile/web-library/folder/file.json\n //\n // The result will be the first path that exists, or undefined if the config file was not found.\n console.log('Resolved config file: ' + rigConfig.tryResolveConfigFilePath('folder/file.json'));\n}\n```\n\nNote that there are also async variants of the functions that access the filesystem.\n\n## Links\n\n- [CHANGELOG.md](\n https://github.com/microsoft/rushstack/blob/master/libraries/rig-package/CHANGELOG.md) - Find\n out what's new in the latest version\n- [API Reference](https://rushstack.io/pages/api/rig-package/)\n\n`@rushstack/rig-package` is part of the [Rush Stack](https://rushstack.io/) family of projects.\n"
}

@@ -0,0 +0,0 @@ # @rushstack/rig-package

{
"name": "@rushstack/rig-package",
"entries": [
{
"version": "0.3.7",
"tag": "@rushstack/rig-package_v0.3.7",
"date": "Mon, 27 Dec 2021 16:10:40 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.5.1`"
}
]
}
},
{
"version": "0.3.6",
"tag": "@rushstack/rig-package_v0.3.6",
"date": "Mon, 06 Dec 2021 16:08:32 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.5.0`"
}
]
}
},
{
"version": "0.3.5",
"tag": "@rushstack/rig-package_v0.3.5",
"date": "Fri, 05 Nov 2021 15:09:18 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.4.5`"
}
]
}
},
{
"version": "0.3.4",
"tag": "@rushstack/rig-package_v0.3.4",
"date": "Wed, 27 Oct 2021 00:08:15 GMT",
"comments": {
"patch": [
{
"comment": "Update the package.json repository field to include the directory property."
}
],
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.4.4`"
}
]
}
},
{
"version": "0.3.3",
"tag": "@rushstack/rig-package_v0.3.3",
"date": "Wed, 13 Oct 2021 15:09:54 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.4.3`"
}
]
}
},
{
"version": "0.3.2",
"tag": "@rushstack/rig-package_v0.3.2",
"date": "Thu, 07 Oct 2021 07:13:35 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.4.2`"
}
]
}
},
{
"version": "0.3.1",
"tag": "@rushstack/rig-package_v0.3.1",
"date": "Thu, 23 Sep 2021 00:10:41 GMT",
"comments": {
"patch": [
{
"comment": "Upgrade the `@types/node` dependency to version to version 12."
}
],
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.4.1`"
}
]
}
},
{
"version": "0.3.0",
"tag": "@rushstack/rig-package_v0.3.0",
"date": "Fri, 27 Aug 2021 00:07:25 GMT",
"comments": {
"minor": [
{
"comment": "Cache rig.json reads"
}
]
}
},
{
"version": "0.2.13",
"tag": "@rushstack/rig-package_v0.2.13",
"date": "Mon, 12 Jul 2021 23:08:26 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.4.0`"
}
]
}
},
{
"version": "0.2.12",
"tag": "@rushstack/rig-package_v0.2.12",
"date": "Mon, 12 Apr 2021 15:10:28 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.3.4`"
}
]
}
},
{
"version": "0.2.11",
"tag": "@rushstack/rig-package_v0.2.11",
"date": "Tue, 06 Apr 2021 15:14:22 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.3.3`"
}
]
}
},
{
"version": "0.2.10",
"tag": "@rushstack/rig-package_v0.2.10",
"date": "Thu, 04 Mar 2021 01:11:31 GMT",
"comments": {
"patch": [
{
"comment": "Eliminate dependency on @types/node"
}
]
}
},
{
"version": "0.2.9",
"tag": "@rushstack/rig-package_v0.2.9",
"date": "Thu, 10 Dec 2020 23:25:49 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.3.2`"
}
]
}
},
{
"version": "0.2.8",
"tag": "@rushstack/rig-package_v0.2.8",
"date": "Wed, 11 Nov 2020 01:08:59 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.3.1`"
}
]
}
},
{
"version": "0.2.7",
"tag": "@rushstack/rig-package_v0.2.7",
"date": "Fri, 30 Oct 2020 06:38:39 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.3.0`"
}
]
}
},
{
"version": "0.2.6",
"tag": "@rushstack/rig-package_v0.2.6",
"date": "Fri, 30 Oct 2020 00:10:14 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.2.3`"
}
]
}
},
{
"version": "0.2.5",
"tag": "@rushstack/rig-package_v0.2.5",
"date": "Wed, 28 Oct 2020 01:18:03 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.2.2`"
}
]
}
},
{
"version": "0.2.4",
"tag": "@rushstack/rig-package_v0.2.4",
"date": "Tue, 06 Oct 2020 00:24:06 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.2.1`"
}
]
}
},
{
"version": "0.2.3",
"tag": "@rushstack/rig-package_v0.2.3",
"date": "Mon, 05 Oct 2020 22:36:57 GMT",
"comments": {
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.2.0`"
}
]
}
},
{
"version": "0.2.2",
"tag": "@rushstack/rig-package_v0.2.2",
"date": "Mon, 05 Oct 2020 15:10:42 GMT",
"comments": {
"patch": [
{
"comment": "Fix minor mistake in README.md"
}
]
}
},
{
"version": "0.2.1",
"tag": "@rushstack/rig-package_v0.2.1",
"date": "Wed, 30 Sep 2020 18:39:17 GMT",
"comments": {
"patch": [
{
"comment": "Update to build with @rushstack/heft-node-rig"
}
],
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.1.3`"
}
]
}
},
{
"version": "0.2.0",
"tag": "@rushstack/rig-package_v0.2.0",
"date": "Wed, 30 Sep 2020 06:53:53 GMT",
"comments": {
"minor": [
{
"comment": "Update the rig package guidance to place tool configuration files that would normally be in a \"config\" folder in a \"config\" folder inside the rig package as well."
},
{
"comment": "Add ILoadForProjectFolderOptions.overrideRigJsonObject"
},
{
"comment": "Add RigConfig.tryResolveConfigFilePath()"
},
{
"comment": "Upgrade compiler; the API now requires TypeScript 3.9 or newer"
}
],
"patch": [
{
"comment": "Report an error if the specified \"rigProfile\" is not defined by the rig package"
},
{
"comment": "Update README.md"
}
],
"dependency": [
{
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.1.2`"
}
]
}
},
{
"version": "0.1.0",
"tag": "@rushstack/rig-package_v0.1.0",
"date": "Fri, 25 Sep 2020 08:13:01 GMT",
"comments": {
"minor": [
{
"comment": "Initial release"
}
]
}
}
]
}
# Change Log - @rushstack/rig-package
This log was last generated on Mon, 27 Dec 2021 16:10:40 GMT and should not be manually modified.
## 0.3.7
Mon, 27 Dec 2021 16:10:40 GMT
_Version update only_
## 0.3.6
Mon, 06 Dec 2021 16:08:32 GMT
_Version update only_
## 0.3.5
Fri, 05 Nov 2021 15:09:18 GMT
_Version update only_
## 0.3.4
Wed, 27 Oct 2021 00:08:15 GMT
### Patches
- Update the package.json repository field to include the directory property.
## 0.3.3
Wed, 13 Oct 2021 15:09:54 GMT
_Version update only_
## 0.3.2
Thu, 07 Oct 2021 07:13:35 GMT
_Version update only_
## 0.3.1
Thu, 23 Sep 2021 00:10:41 GMT
### Patches
- Upgrade the `@types/node` dependency to version to version 12.
## 0.3.0
Fri, 27 Aug 2021 00:07:25 GMT
### Minor changes
- Cache rig.json reads
## 0.2.13
Mon, 12 Jul 2021 23:08:26 GMT
_Version update only_
## 0.2.12
Mon, 12 Apr 2021 15:10:28 GMT
_Version update only_
## 0.2.11
Tue, 06 Apr 2021 15:14:22 GMT
_Version update only_
## 0.2.10
Thu, 04 Mar 2021 01:11:31 GMT
### Patches
- Eliminate dependency on @types/node
## 0.2.9
Thu, 10 Dec 2020 23:25:49 GMT
_Version update only_
## 0.2.8
Wed, 11 Nov 2020 01:08:59 GMT
_Version update only_
## 0.2.7
Fri, 30 Oct 2020 06:38:39 GMT
_Version update only_
## 0.2.6
Fri, 30 Oct 2020 00:10:14 GMT
_Version update only_
## 0.2.5
Wed, 28 Oct 2020 01:18:03 GMT
_Version update only_
## 0.2.4
Tue, 06 Oct 2020 00:24:06 GMT
_Version update only_
## 0.2.3
Mon, 05 Oct 2020 22:36:57 GMT
_Version update only_
## 0.2.2
Mon, 05 Oct 2020 15:10:42 GMT
### Patches
- Fix minor mistake in README.md
## 0.2.1
Wed, 30 Sep 2020 18:39:17 GMT
### Patches
- Update to build with @rushstack/heft-node-rig
## 0.2.0
Wed, 30 Sep 2020 06:53:53 GMT
### Minor changes
- Update the rig package guidance to place tool configuration files that would normally be in a "config" folder in a "config" folder inside the rig package as well.
- Add ILoadForProjectFolderOptions.overrideRigJsonObject
- Add RigConfig.tryResolveConfigFilePath()
- Upgrade compiler; the API now requires TypeScript 3.9 or newer
### Patches
- Report an error if the specified "rigProfile" is not defined by the rig package
- Update README.md
## 0.1.0
Fri, 25 Sep 2020 08:13:01 GMT
### Minor changes
- Initial release