@rushstack/rig-package
Advanced tools
+12
-0
@@ -5,2 +5,14 @@ { | ||
| { | ||
| "version": "0.6.0", | ||
| "tag": "@rushstack/rig-package_v0.6.0", | ||
| "date": "Fri, 03 Oct 2025 20:09:59 GMT", | ||
| "comments": { | ||
| "minor": [ | ||
| { | ||
| "comment": "Normalize import of builtin modules to use the `node:` protocol." | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "version": "0.5.3", | ||
@@ -7,0 +19,0 @@ "tag": "@rushstack/rig-package_v0.5.3", |
+8
-1
| # Change Log - @rushstack/rig-package | ||
| This log was last generated on Sat, 27 Jul 2024 00:10:27 GMT and should not be manually modified. | ||
| This log was last generated on Fri, 03 Oct 2025 20:09:59 GMT and should not be manually modified. | ||
| ## 0.6.0 | ||
| Fri, 03 Oct 2025 20:09:59 GMT | ||
| ### Minor changes | ||
| - Normalize import of builtin modules to use the `node:` protocol. | ||
| ## 0.5.3 | ||
@@ -6,0 +13,0 @@ Sat, 27 Jul 2024 00:10:27 GMT |
@@ -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.46.2" | ||
| "packageVersion": "7.52.15" | ||
| } | ||
| ] | ||
| } |
+1
-2
@@ -1,3 +0,2 @@ | ||
| /// <reference types="node" /> | ||
| import * as fs from 'fs'; | ||
| import * as fs from 'node:fs'; | ||
| import nodeResolve from 'resolve'; | ||
@@ -4,0 +3,0 @@ export declare class Helpers { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"Helpers.d.ts","sourceRoot":"","sources":["../src/Helpers.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,WAAW,MAAM,SAAS,CAAC;AAGlC,qBAAa,OAAO;IAElB,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAsC;WAExD,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;WAY1E,aAAa,CAAC,cAAc,EAAE,EAAE,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;WASlE,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;CAU7D"} | ||
| {"version":3,"file":"Helpers.d.ts","sourceRoot":"","sources":["../src/Helpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,WAAW,MAAM,SAAS,CAAC;AAGlC,qBAAa,OAAO;IAElB,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAsC;WAExD,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;WAY1E,aAAa,CAAC,cAAc,EAAE,EAAE,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;WASlE,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;CAU7D"} |
+19
-9
@@ -20,9 +20,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) { | ||
@@ -33,4 +43,4 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| exports.Helpers = void 0; | ||
| const path = __importStar(require("path")); | ||
| const fs = __importStar(require("fs")); | ||
| const path = __importStar(require("node:path")); | ||
| const fs = __importStar(require("node:fs")); | ||
| const resolve_1 = __importDefault(require("resolve")); | ||
@@ -37,0 +47,0 @@ // These helpers avoid taking dependencies on other NPM packages |
@@ -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,CAAC;oBACV,MAAM,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,MAAO,CAAC,CAAC;gBACnB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,cAA2B;QAC3D,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAkC,EAAE,EAAE;YAC9D,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,MAAe,EAAE,EAAE;gBAC5C,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,CAAC;YAC/B,OAAO,KAAK,CAAC;QACf,CAAC;QACD,uBAAuB;QACvB,IAAI,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YACpD,OAAO,KAAK,CAAC;QACf,CAAC;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.\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(filesystemPath: fs.PathLike): Promise<boolean> {\n return await new Promise((resolve: (result: boolean) => void) => {\n fs.exists(filesystemPath, (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"]} | ||
| {"version":3,"file":"Helpers.js","sourceRoot":"","sources":["../src/Helpers.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W,0BAA0B,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 'node:path';\nimport * as fs from 'node:fs';\n\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(filesystemPath: fs.PathLike): Promise<boolean> {\n return await new Promise((resolve: (result: boolean) => void) => {\n fs.exists(filesystemPath, (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":"RigConfig.d.ts","sourceRoot":"","sources":["../src/RigConfig.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;OAOG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAWD;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,cAAc,CAAC;IAEvC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CAC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__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) { | ||
@@ -33,4 +43,4 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| exports.RigConfig = void 0; | ||
| const path = __importStar(require("path")); | ||
| const fs = __importStar(require("fs")); | ||
| const path = __importStar(require("node:path")); | ||
| const fs = __importStar(require("node:fs")); | ||
| const nodeResolve = __importStar(require("resolve")); | ||
@@ -37,0 +47,0 @@ const strip_json_comments_1 = __importDefault(require("strip-json-comments")); |
@@ -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;AAwKpC;;;;GAIG;AACH,MAAa,SAAS;IAqEpB,YAAoB,OAA0B;QAC5C,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,OAAO,C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Ae,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.\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 interface IRigConfig {\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 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 readonly projectFolderPath: string;\n\n /**\n * Returns `true` if `config/rig.json` was found, or `false` otherwise.\n */\n 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 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 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 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 readonly relativeProfileFolderPath: string;\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 getResolvedProfileFolder(): string;\n\n /**\n * An async variant of {@link IRigConfig.getResolvedProfileFolder}\n */\n getResolvedProfileFolderAsync(): Promise<string>;\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 tryResolveConfigFilePath(configFileRelativePath: string): string | undefined;\n\n /**\n * An async variant of {@link IRigConfig.tryResolveConfigFilePath}\n */\n tryResolveConfigFilePathAsync(configFileRelativePath: string): Promise<string | undefined>;\n}\n\n/**\n * {@inheritdoc IRigConfig}\n *\n * @public\n */\nexport class RigConfig implements IRigConfig {\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 * {@inheritdoc IRigConfig.projectFolderOriginalPath}\n */\n public readonly projectFolderOriginalPath: string;\n\n /**\n * {@inheritdoc IRigConfig.projectFolderPath}\n */\n public readonly projectFolderPath: string;\n\n /**\n * {@inheritdoc IRigConfig.rigFound}\n */\n public readonly rigFound: boolean;\n\n /**\n * {@inheritdoc IRigConfig.filePath}\n */\n public readonly filePath: string;\n\n /**\n * {@inheritdoc IRigConfig.rigPackageName}\n */\n public readonly rigPackageName: string;\n\n /**\n * {@inheritdoc IRigConfig.rigProfile}\n */\n public readonly rigProfile: string;\n\n /**\n * {@inheritdoc IRigConfig.relativeProfileFolderPath}\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 * {@inheritdoc IRigConfig.getResolvedProfileFolder}\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 * {@inheritdoc IRigConfig.getResolvedProfileFolderAsync}\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 * {@inheritdoc IRigConfig.tryResolveConfigFilePath}\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 * {@inheritdoc IRigConfig.tryResolveConfigFilePathAsync}\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"]} | ||
| {"version":3,"file":"RigConfig.js","sourceRoot":"","sources":["../src/RigConfig.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,gDAAkC;AAClC,4CAA8B;AAE9B,qDAAuC;AACvC,8EAAoD;AAEpD,uCAAoC;AAwKpC;;;;GAIG;AACH,MAAa,SAAS;IAqEpB,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,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI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AAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC7D,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;YAC5D,MAAM,IAAI,KAAK,CACb,+DAA+D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CACrG,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,KAAK,CACb,2DAA2D,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAC9F,CAAC;QACJ,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAClC,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;gBACxD,MAAM,IAAI,KAAK,CACb,sFAAsF;oBACpF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAClC,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;;AA5WH,8BA6WC;AA5WC,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.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'node:path';\nimport * as fs from 'node:fs';\n\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 interface IRigConfig {\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 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 readonly projectFolderPath: string;\n\n /**\n * Returns `true` if `config/rig.json` was found, or `false` otherwise.\n */\n 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 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 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 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 readonly relativeProfileFolderPath: string;\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 getResolvedProfileFolder(): string;\n\n /**\n * An async variant of {@link IRigConfig.getResolvedProfileFolder}\n */\n getResolvedProfileFolderAsync(): Promise<string>;\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 tryResolveConfigFilePath(configFileRelativePath: string): string | undefined;\n\n /**\n * An async variant of {@link IRigConfig.tryResolveConfigFilePath}\n */\n tryResolveConfigFilePathAsync(configFileRelativePath: string): Promise<string | undefined>;\n}\n\n/**\n * {@inheritdoc IRigConfig}\n *\n * @public\n */\nexport class RigConfig implements IRigConfig {\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 * {@inheritdoc IRigConfig.projectFolderOriginalPath}\n */\n public readonly projectFolderOriginalPath: string;\n\n /**\n * {@inheritdoc IRigConfig.projectFolderPath}\n */\n public readonly projectFolderPath: string;\n\n /**\n * {@inheritdoc IRigConfig.rigFound}\n */\n public readonly rigFound: boolean;\n\n /**\n * {@inheritdoc IRigConfig.filePath}\n */\n public readonly filePath: string;\n\n /**\n * {@inheritdoc IRigConfig.rigPackageName}\n */\n public readonly rigPackageName: string;\n\n /**\n * {@inheritdoc IRigConfig.rigProfile}\n */\n public readonly rigProfile: string;\n\n /**\n * {@inheritdoc IRigConfig.relativeProfileFolderPath}\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 * {@inheritdoc IRigConfig.getResolvedProfileFolder}\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 * {@inheritdoc IRigConfig.getResolvedProfileFolderAsync}\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 * {@inheritdoc IRigConfig.tryResolveConfigFilePath}\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 * {@inheritdoc IRigConfig.tryResolveConfigFilePathAsync}\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"]} |
+4
-6
| { | ||
| "name": "@rushstack/rig-package", | ||
| "version": "0.5.3", | ||
| "version": "0.6.0", | ||
| "description": "A system for sharing tool configurations between projects without duplicating config files.", | ||
@@ -18,10 +18,8 @@ "main": "lib/index.js", | ||
| "devDependencies": { | ||
| "@rushstack/heft-node-rig": "2.6.15", | ||
| "@rushstack/heft": "0.66.17", | ||
| "@types/heft-jest": "1.0.1", | ||
| "@types/node": "18.17.15", | ||
| "@rushstack/heft": "1.0.0", | ||
| "@types/resolve": "1.20.2", | ||
| "ajv": "~8.13.0", | ||
| "eslint": "~9.25.1", | ||
| "resolve": "~1.22.1", | ||
| "local-eslint-config": "1.0.0" | ||
| "decoupled-local-node-rig": "1.0.0" | ||
| }, | ||
@@ -28,0 +26,0 @@ "scripts": { |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
97488
1.09%6
-25%1512
2.09%0
-100%