@rushstack/rush-sdk 5.57.1 → 5.59.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,26 +1,26 @@
1
- ## @rushstack/rush-sdk
2
-
3
- This is a companion package for the Rush tool. See the [@microsoft/rush](https://www.npmjs.com/package/@microsoft/rush) package for details.
4
-
5
- ⚠ ***THIS PACKAGE IS EXPERIMENTAL*** ⚠
6
-
7
- The **@rushstack/rush-sdk** package acts as a lightweight proxy for accessing the APIs of the **@microsoft/rush-lib** engine. It is intended to support three different use cases:
8
-
9
- 1. Rush plugins should import from **@rushstack/rush-sdk** instead of **@microsoft/rush-lib**. This gives plugins full access to Rush APIs while avoiding a redundant installation of those packages. At runtime, the APIs will be bound to the correct `rushVersion` from **rush.json**, and guaranteed to be the same **@microsoft/rush-lib** module instance as the plugin host.
10
-
11
- 2. When authoring unit tests for a Rush plugin, developers should add **@microsoft/rush-lib** to their **package.json** `devDependencies`. In this context, **@rushstack/rush-sdk** will resolve to that instance for testing purposes.
12
-
13
- 3. **(Not implemented yet)** For scripts and tools that are designed to be used in a Rush monorepo, in the future **@rushstack/rush-sdk** will automatically invoke **install-run-rush.js** and load the local installation. This ensures that tools load a compatible version of the Rush engine for the given branch. Once this is implemented, **@rushstack/rush-sdk** can replace **@microsoft/rush-lib** entirely as the official API interface, with the latter serving as the underlying implementation.
14
-
15
-
16
- The **@rushstack/rush-sdk** API declarations are identical to the corresponding version of **@microsoft/rush-lib**.
17
-
18
-
19
- ## Links
20
-
21
- - [CHANGELOG.md](
22
- https://github.com/microsoft/rushstack/blob/master/apps/rush/CHANGELOG.md) - Find
23
- out what's new in the latest version
24
- - [API Reference](https://rushstack.io/pages/api/rush-lib/)
25
-
26
- Rush is part of the [Rush Stack](https://rushstack.io/) family of projects.
1
+ ## @rushstack/rush-sdk
2
+
3
+ This is a companion package for the Rush tool. See the [@microsoft/rush](https://www.npmjs.com/package/@microsoft/rush) package for details.
4
+
5
+ ⚠ ***THIS PACKAGE IS EXPERIMENTAL*** ⚠
6
+
7
+ The **@rushstack/rush-sdk** package acts as a lightweight proxy for accessing the APIs of the **@microsoft/rush-lib** engine. It is intended to support three different use cases:
8
+
9
+ 1. Rush plugins should import from **@rushstack/rush-sdk** instead of **@microsoft/rush-lib**. This gives plugins full access to Rush APIs while avoiding a redundant installation of those packages. At runtime, the APIs will be bound to the correct `rushVersion` from **rush.json**, and guaranteed to be the same **@microsoft/rush-lib** module instance as the plugin host.
10
+
11
+ 2. When authoring unit tests for a Rush plugin, developers should add **@microsoft/rush-lib** to their **package.json** `devDependencies`. In this context, **@rushstack/rush-sdk** will resolve to that instance for testing purposes.
12
+
13
+ 3. **(Not implemented yet)** For scripts and tools that are designed to be used in a Rush monorepo, in the future **@rushstack/rush-sdk** will automatically invoke **install-run-rush.js** and load the local installation. This ensures that tools load a compatible version of the Rush engine for the given branch. Once this is implemented, **@rushstack/rush-sdk** can replace **@microsoft/rush-lib** entirely as the official API interface, with the latter serving as the underlying implementation.
14
+
15
+
16
+ The **@rushstack/rush-sdk** API declarations are identical to the corresponding version of **@microsoft/rush-lib**.
17
+
18
+
19
+ ## Links
20
+
21
+ - [CHANGELOG.md](
22
+ https://github.com/microsoft/rushstack/blob/master/apps/rush/CHANGELOG.md) - Find
23
+ out what's new in the latest version
24
+ - [API Reference](https://rushstack.io/pages/api/rush-lib/)
25
+
26
+ Rush is part of the [Rush Stack](https://rushstack.io/) family of projects.
@@ -603,6 +603,13 @@ declare interface IBaseBuildCacheJson {
603
603
  */
604
604
  declare type IBuildCacheJson = ICloudBuildCacheJson | ILocalBuildCacheJson;
605
605
 
606
+ /**
607
+ * @internal
608
+ */
609
+ export declare interface _IBuiltInPluginConfiguration extends _IRushPluginConfigurationBase {
610
+ pluginPackageFolder: string;
611
+ }
612
+
606
613
  /**
607
614
  * @beta
608
615
  */
@@ -721,12 +728,10 @@ export declare interface IExperimentsJson {
721
728
  */
722
729
  buildCacheWithAllowWarningsInSuccessfulBuild?: boolean;
723
730
  /**
724
- * If true, the multi-phase commands feature is enabled. To use this feature, create a "phased" command
731
+ * If true, the phased commands feature is enabled. To use this feature, create a "phased" command
725
732
  * in common/config/rush/command-line.json.
726
- *
727
- * THIS FEATURE IS NOT READY FOR USAGE YET. SEE GITHUB #2300 FOR STATUS.
728
733
  */
729
- _multiPhaseCommands?: boolean;
734
+ phasedCommands?: boolean;
730
735
  }
731
736
 
732
737
  /**
@@ -736,6 +741,16 @@ export declare interface IGetChangedProjectsOptions {
736
741
  targetBranchName: string;
737
742
  terminal: ITerminal;
738
743
  shouldFetch?: boolean;
744
+ /**
745
+ * If set to `true`, consider a project's external dependency installation layout as defined in the
746
+ * package manager lockfile when determining if it has changed.
747
+ */
748
+ includeExternalDependencies: boolean;
749
+ /**
750
+ * If set to `true` apply the `incrementalBuildIgnoredGlobs` property in a project's `rush-project.json`
751
+ * and exclude matched files from change detection.
752
+ */
753
+ enableFiltering: boolean;
739
754
  }
740
755
 
741
756
  declare interface IIndividualVersionJson extends IVersionPolicyJson {
@@ -759,6 +774,12 @@ export declare interface ILaunchOptions {
759
774
  * with this version of Rush, so we shouldn't print a similar error.
760
775
  */
761
776
  alreadyReportedNodeTooNewError?: boolean;
777
+ /**
778
+ * Used to specify Rush plugins that are dependencies of the "\@microsoft/rush" package.
779
+ *
780
+ * @internal
781
+ */
782
+ builtInPluginConfigurations?: _IBuiltInPluginConfiguration[];
762
783
  }
763
784
 
764
785
  /**
@@ -935,11 +956,14 @@ export declare interface IRushPlugin {
935
956
  apply(rushSession: RushSession, rushConfiguration: RushConfiguration): void;
936
957
  }
937
958
 
938
- declare interface IRushPluginConfiguration extends IRushPluginConfigurationBase {
959
+ declare interface IRushPluginConfiguration extends _IRushPluginConfigurationBase {
939
960
  autoinstallerName: string;
940
961
  }
941
962
 
942
- declare interface IRushPluginConfigurationBase {
963
+ /**
964
+ * @internal
965
+ */
966
+ export declare interface _IRushPluginConfigurationBase {
943
967
  packageName: string;
944
968
  pluginName: string;
945
969
  }
@@ -948,14 +972,12 @@ declare interface IRushPluginsConfigurationJson {
948
972
  plugins: IRushPluginConfiguration[];
949
973
  }
950
974
 
975
+ declare type IRushRepositoryJson = IRushRepositoryJsonSingleUrl | IRushRepositoryJsonMultipleUrls;
976
+
951
977
  /**
952
978
  * Part of IRushConfigurationJson.
953
979
  */
954
- declare interface IRushRepositoryJson {
955
- /**
956
- * The remote url of the repository. This helps "rush change" find the right remote to compare against.
957
- */
958
- url?: string;
980
+ declare interface IRushRepositoryJsonBase {
959
981
  /**
960
982
  * The default branch name. This tells "rush change" which remote branch to compare against.
961
983
  */
@@ -967,6 +989,26 @@ declare interface IRushRepositoryJson {
967
989
  defaultRemote?: string;
968
990
  }
969
991
 
992
+ declare interface IRushRepositoryJsonMultipleUrls extends IRushRepositoryJsonBase {
993
+ /**
994
+ * Remote url(s) of the repository. If a value is provided, \"rush change\" will
995
+ * use one of these to find the right remote to compare against. Specifying multiple URLs
996
+ * is useful if a GitHub repository is renamed or for "<projectName>.visualstudio.com" vs
997
+ * "dev.azure.com/<projectName>" URLs.
998
+ */
999
+ urls?: string[];
1000
+ }
1001
+
1002
+ declare interface IRushRepositoryJsonSingleUrl extends IRushRepositoryJsonBase {
1003
+ /**
1004
+ * The remote url of the repository. If a value is provided,
1005
+ * \"rush change\" will use it to find the right remote to compare against.
1006
+ *
1007
+ * @deprecated Use "urls" instead.
1008
+ */
1009
+ url?: string;
1010
+ }
1011
+
970
1012
  /**
971
1013
  * @beta
972
1014
  */
@@ -1429,9 +1471,9 @@ export declare class ProjectChangeAnalyzer {
1429
1471
  * undefined === data isn't available (i.e. - git isn't present)
1430
1472
  */
1431
1473
  private _data;
1432
- private _filteredData;
1433
- private _projectStateCache;
1434
- private _rushConfiguration;
1474
+ private readonly _filteredData;
1475
+ private readonly _projectStateCache;
1476
+ private readonly _rushConfiguration;
1435
1477
  private readonly _git;
1436
1478
  constructor(rushConfiguration: RushConfiguration);
1437
1479
  /**
@@ -1459,16 +1501,10 @@ export declare class ProjectChangeAnalyzer {
1459
1501
  _filterProjectDataAsync<T>(project: RushConfigurationProject, unfilteredProjectData: Map<string, T>, rootDir: string, terminal: ITerminal): Promise<Map<string, T>>;
1460
1502
  /**
1461
1503
  * Gets a list of projects that have changed in the current state of the repo
1462
- * when compared to the specified branch.
1463
- */
1464
- getProjectsWithChangesAsync(options: IGetChangedProjectsOptions): Promise<Set<RushConfigurationProject>>;
1465
- /**
1466
- * Gets a list of projects that have changed in the current state of the repo
1467
- * when compared to the specified branch, taking the shrinkwrap and settings in
1504
+ * when compared to the specified branch, optionally taking the shrinkwrap and settings in
1468
1505
  * the rush-project.json file into consideration.
1469
1506
  */
1470
- getProjectsImpactedByDiffAsync(options: IGetChangedProjectsOptions): Promise<Set<RushConfigurationProject>>;
1471
- private _getChangedProjectsInternalAsync;
1507
+ getChangedProjectsAsync(options: IGetChangedProjectsOptions): Promise<Set<RushConfigurationProject>>;
1472
1508
  private _getData;
1473
1509
  private _getIgnoreMatcherForProjectAsync;
1474
1510
  private _getRepoDeps;
@@ -1620,7 +1656,7 @@ export declare class RushConfiguration {
1620
1656
  private _gitChangeLogUpdateCommitMessage;
1621
1657
  private _gitTagSeparator;
1622
1658
  private _hotfixChangeEnabled;
1623
- private _repositoryUrl;
1659
+ private _repositoryUrls;
1624
1660
  private _repositoryDefaultBranch;
1625
1661
  private _repositoryDefaultRemote;
1626
1662
  private _npmOptions;
@@ -1898,9 +1934,12 @@ export declare class RushConfiguration {
1898
1934
  */
1899
1935
  get hotfixChangeEnabled(): boolean;
1900
1936
  /**
1901
- * The remote url of the repository. This helps "rush change" find the right remote to compare against.
1937
+ * Remote URL(s) of the repository. If a value is provided, \"rush change\" will
1938
+ * use one of these to find the right remote to compare against. Specifying multiple URLs
1939
+ * is useful if a GitHub repository is renamed or for "<projectName>.visualstudio.com" vs
1940
+ * "dev.azure.com/<projectName>" URLs.
1902
1941
  */
1903
- get repositoryUrl(): string | undefined;
1942
+ get repositoryUrls(): string[];
1904
1943
  /**
1905
1944
  * The default branch name. This tells "rush change" which remote branch to compare against.
1906
1945
  */
@@ -2450,6 +2489,14 @@ export declare class RushConstants {
2450
2489
  * The name of the per-user Rush configuration data folder.
2451
2490
  */
2452
2491
  static readonly rushUserConfigurationFolderName: string;
2492
+ /**
2493
+ * The name of the project `rush-logs` folder.
2494
+ */
2495
+ static readonly rushLogsFolderName: string;
2496
+ /**
2497
+ * The expected prefix for phase names in "common/config/rush/command-line.json"
2498
+ */
2499
+ static readonly phaseNamePrefix: '_phase:';
2453
2500
  }
2454
2501
 
2455
2502
  /**
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,oEAAuF;AAEvF,MAAM,aAAa,GAAW,qBAAqB,CAAC;AAQpD,qGAAqG;AACrG,gGAAgG;AAChG,IAAI,aAAa,GAAkC,MAAM,CAAC,uBAAuB,CAAC;AAElF,6FAA6F;AAC7F,+FAA+F;AAC/F,IAAI,aAAa,KAAK,SAAS,EAAE;IAC/B,MAAM,aAAa,GAAuB,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,QAAQ,CAAC;IACnE,IAAI,aAAa,KAAK,SAAS,EAAE;QAC/B,MAAM,mBAAmB,GACvB,qCAAiB,CAAC,QAAQ,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC;QAEnE,IAAI,mBAAmB,KAAK,SAAS,EAAE;YACrC,MAAM,iBAAiB,GAAiB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC,CAAC;YAEhG,6DAA6D;YAC7D,IACE,CAAC,iBAAiB,CAAC,YAAY,IAAI,iBAAiB,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,SAA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ent":["// 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 { Import, IPackageJson, PackageJsonLookup } from '@rushstack/node-core-library';\r\n\r\nconst RUSH_LIB_NAME: string = '@microsoft/rush-lib';\r\n\r\ntype RushLibModuleType = Record<string, unknown>;\r\ndeclare const global: NodeJS.Global &\r\n typeof globalThis & {\r\n ___rush___rushLibModule?: RushLibModuleType;\r\n };\r\n\r\n// SCENARIO 1: Rush's PluginManager has initialized \"rush-sdk\" with Rush's own instance of rush-lib.\r\n// The Rush host process will assign \"global.___rush___rushLibModule\" before loading the plugin.\r\nlet rushLibModule: RushLibModuleType | undefined = global.___rush___rushLibModule;\r\n\r\n// SCENARIO 2: The project importing \"rush-sdk\" has installed its own instance of \"rush-lib\"\r\n// as a package.json dependency. For example, this is used by the Jest tests for Rush plugins.\r\nif (rushLibModule === undefined) {\r\n const importingPath: string | undefined = module?.parent?.filename;\r\n if (importingPath !== undefined) {\r\n const callerPackageFolder: string | undefined =\r\n PackageJsonLookup.instance.tryGetPackageFolderFor(importingPath);\r\n\r\n if (callerPackageFolder !== undefined) {\r\n const callerPackageJson: IPackageJson = require(path.join(callerPackageFolder, 'package.json'));\r\n\r\n // Does the caller properly declare a dependency on rush-lib?\r\n if (\r\n (callerPackageJson.dependencies && callerPackageJson.dependencies[RUSH_LIB_NAME] !== undefined) ||\r\n (callerPackageJson.devDependencies &&\r\n callerPackageJson.devDependencies[RUSH_LIB_NAME] !== undefined) ||\r\n (callerPackageJson.peerDependencies &&\r\n callerPackageJson.peerDependencies[RUSH_LIB_NAME] !== undefined)\r\n ) {\r\n // Try to resolve rush-lib from the caller's folder\r\n try {\r\n const rushLibModulePath: string = Import.resolveModule({\r\n modulePath: RUSH_LIB_NAME,\r\n baseFolderPath: callerPackageFolder\r\n });\r\n\r\n rushLibModule = require(rushLibModulePath);\r\n } catch (error) {\r\n // If we fail to resolve it, ignore the error\r\n }\r\n\r\n // If two different libraries invoke `rush-sdk`, and one of them provides \"rush-lib\"\r\n // then the first version to be loaded wins. We do not support side-by-side instances of \"rush-lib\".\r\n if (rushLibModule !== undefined) {\r\n // TODO: When we implement Scenario 3, we should also add some diagnostic state\r\n // to track which scenario is active and how it got initialized.\r\n global.___rush___rushLibModule = rushLibModule;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n// SCENARIO 3: A tool or script depends on \"rush-sdk\", and is meant to be used inside a monorepo folder.\r\n// In this case, we can use install-run-rush.js to obtain the appropriate rush-lib version for the monorepo.\r\n//\r\n// NOT IMPLEMENTED YET\r\nif (rushLibModule === undefined) {\r\n // This error indicates that a project is trying to import \"@rushstack/rush-sdk\", but the Rush engine\r\n // instance cannot be found. If you are writing Jest tests for a Rush plugin, add \"@microsoft/rush-lib\"\r\n // to the devDependencies for your project.\r\n throw new Error('The \"@rushstack/rush-sdk\" package context has not been initialized.');\r\n}\r\n\r\n// Based on TypeScript's __exportStar()\r\nfor (const property in rushLibModule) {\r\n if (property !== 'default' && !exports.hasOwnProperty(property)) {\r\n const rushLibModuleForClosure: RushLibModuleType = rushLibModule;\r\n\r\n // Based on TypeScript's __createBinding()\r\n Object.defineProperty(exports, property, {\r\n enumerable: true,\r\n get: function () {\r\n return rushLibModuleForClosure[property];\r\n }\r\n });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,oEAAuF;AAEvF,MAAM,aAAa,GAAW,qBAAqB,CAAC;AAQpD,qGAAqG;AACrG,gGAAgG;AAChG,IAAI,aAAa,GAAkC,MAAM,CAAC,uBAAuB,CAAC;AAElF,6FAA6F;AAC7F,+FAA+F;AAC/F,IAAI,aAAa,KAAK,SAAS,EAAE;IAC/B,MAAM,aAAa,GAAuB,MAAA,MAAM,aAAN,MAAM,uBA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EAAqE,CAAC,CAAC;CACxF;AAED,uCAAuC;AACvC,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE;IACpC,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QAC/D,MAAM,uBAAuB,GAAsB,aAAa,CAAC;QAEjE,0CAA0C;QAC1C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE;YACvC,UAAU,EAAE,IAAI;YAChB,GAAG,EAAE;gBACH,OAAO,uBAAuB,CAAC,QAAQ,CAAC,CAAC;YAC3C,CAAC;SACF,CAAC,CAAC;KACJ;CACF","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 { Import, IPackageJson, PackageJsonLookup } from '@rushstack/node-core-library';\n\nconst RUSH_LIB_NAME: string = '@microsoft/rush-lib';\n\ntype RushLibModuleType = Record<string, unknown>;\ndeclare const global: NodeJS.Global &\n typeof globalThis & {\n ___rush___rushLibModule?: RushLibModuleType;\n };\n\n// SCENARIO 1: Rush's PluginManager has initialized \"rush-sdk\" with Rush's own instance of rush-lib.\n// The Rush host process will assign \"global.___rush___rushLibModule\" before loading the plugin.\nlet rushLibModule: RushLibModuleType | undefined = global.___rush___rushLibModule;\n\n// SCENARIO 2: The project importing \"rush-sdk\" has installed its own instance of \"rush-lib\"\n// as a package.json dependency. For example, this is used by the Jest tests for Rush plugins.\nif (rushLibModule === undefined) {\n const importingPath: string | undefined = module?.parent?.filename;\n if (importingPath !== undefined) {\n const callerPackageFolder: string | undefined =\n PackageJsonLookup.instance.tryGetPackageFolderFor(importingPath);\n\n if (callerPackageFolder !== undefined) {\n const callerPackageJson: IPackageJson = require(path.join(callerPackageFolder, 'package.json'));\n\n // Does the caller properly declare a dependency on rush-lib?\n if (\n (callerPackageJson.dependencies && callerPackageJson.dependencies[RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.devDependencies &&\n callerPackageJson.devDependencies[RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.peerDependencies &&\n callerPackageJson.peerDependencies[RUSH_LIB_NAME] !== undefined)\n ) {\n // Try to resolve rush-lib from the caller's folder\n try {\n const rushLibModulePath: string = Import.resolveModule({\n modulePath: RUSH_LIB_NAME,\n baseFolderPath: callerPackageFolder\n });\n\n rushLibModule = require(rushLibModulePath);\n } catch (error) {\n // If we fail to resolve it, ignore the error\n }\n\n // If two different libraries invoke `rush-sdk`, and one of them provides \"rush-lib\"\n // then the first version to be loaded wins. We do not support side-by-side instances of \"rush-lib\".\n if (rushLibModule !== undefined) {\n // TODO: When we implement Scenario 3, we should also add some diagnostic state\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModule = rushLibModule;\n }\n }\n }\n }\n}\n\n// SCENARIO 3: A tool or script depends on \"rush-sdk\", and is meant to be used inside a monorepo folder.\n// In this case, we can use install-run-rush.js to obtain the appropriate rush-lib version for the monorepo.\n//\n// NOT IMPLEMENTED YET\nif (rushLibModule === undefined) {\n // This error indicates that a project is trying to import \"@rushstack/rush-sdk\", but the Rush engine\n // instance cannot be found. If you are writing Jest tests for a Rush plugin, add \"@microsoft/rush-lib\"\n // to the devDependencies for your project.\n throw new Error('The \"@rushstack/rush-sdk\" package context has not been initialized.');\n}\n\n// Based on TypeScript's __exportStar()\nfor (const property in rushLibModule) {\n if (property !== 'default' && !exports.hasOwnProperty(property)) {\n const rushLibModuleForClosure: RushLibModuleType = rushLibModule;\n\n // Based on TypeScript's __createBinding()\n Object.defineProperty(exports, property, {\n enumerable: true,\n get: function () {\n return rushLibModuleForClosure[property];\n }\n });\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-sdk",
3
- "version": "5.57.1",
3
+ "version": "5.59.0-rc.2",
4
4
  "description": "An API for interacting with the Rush engine",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,15 +12,15 @@
12
12
  "typings": "dist/rush-lib.d.ts",
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@rushstack/node-core-library": "3.44.1",
15
+ "@rushstack/node-core-library": "3.44.3",
16
16
  "@types/node-fetch": "1.6.9",
17
17
  "tapable": "2.2.1"
18
18
  },
19
19
  "devDependencies": {
20
- "@microsoft/rush-lib": "5.57.1",
21
- "@rushstack/eslint-config": "2.5.0",
22
- "@rushstack/heft": "0.43.1",
23
- "@rushstack/heft-node-rig": "1.4.2",
20
+ "@microsoft/rush-lib": "5.59.0-rc.2",
21
+ "@rushstack/eslint-config": "2.5.1",
22
+ "@rushstack/heft": "0.44.1",
23
+ "@rushstack/heft-node-rig": "1.5.1",
24
24
  "@types/heft-jest": "1.0.1",
25
25
  "@types/node": "12.20.24",
26
26
  "@types/semver": "7.3.5"