@rushstack/rush-sdk 5.64.0 → 5.66.0

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
@@ -23,8 +23,8 @@ Verbose logging can be turn on by set environment variable `RUSH_SDK_DEBUG` to `
23
23
  ## Links
24
24
 
25
25
  - [CHANGELOG.md](
26
- https://github.com/microsoft/rushstack/blob/master/apps/rush/CHANGELOG.md) - Find
26
+ https://github.com/microsoft/rushstack/blob/main/apps/rush/CHANGELOG.md) - Find
27
27
  out what's new in the latest version
28
- - [API Reference](https://rushstack.io/pages/api/rush-lib/)
28
+ - [API Reference](https://api.rushstack.io/pages/rush-lib/)
29
29
 
30
30
  Rush is part of the [Rush Stack](https://rushstack.io/) family of projects.
@@ -5,6 +5,7 @@
5
5
 
6
6
  /// <reference types="node" />
7
7
 
8
+ import { AsyncParallelHook } from 'tapable';
8
9
  import { AsyncSeriesHook } from 'tapable';
9
10
  import { AsyncSeriesWaterfallHook } from 'tapable';
10
11
  import type { CollatedWriter } from '@rushstack/stream-collator';
@@ -1228,6 +1229,7 @@ declare interface IRushConfigurationJson {
1228
1229
  approvedPackagesPolicy?: IApprovedPackagesPolicyJson;
1229
1230
  gitPolicy?: IRushGitPolicyJson;
1230
1231
  telemetryEnabled?: boolean;
1232
+ allowedProjectTags?: string[];
1231
1233
  projects: IRushConfigurationProjectJson[];
1232
1234
  eventHooks?: IEventHooksJson;
1233
1235
  hotfixChangeEnabled?: boolean;
@@ -1250,6 +1252,7 @@ declare interface IRushConfigurationProjectJson {
1250
1252
  shouldPublish?: boolean;
1251
1253
  skipRushCheck?: boolean;
1252
1254
  publishFolder?: string;
1255
+ tags?: string[];
1253
1256
  }
1254
1257
 
1255
1258
  /**
@@ -1268,6 +1271,10 @@ declare interface IRushConfigurationProjectOptions {
1268
1271
  * A unique string name for this project
1269
1272
  */
1270
1273
  tempProjectName: string;
1274
+ /**
1275
+ * If specified, validate project tags against this list.
1276
+ */
1277
+ allowedProjectTags: Set<string> | undefined;
1271
1278
  }
1272
1279
 
1273
1280
  /**
@@ -1357,6 +1364,43 @@ declare interface IRushVariantOptionsJson {
1357
1364
  description: string;
1358
1365
  }
1359
1366
 
1367
+ /**
1368
+ * @beta
1369
+ */
1370
+ export declare interface ITelemetryData {
1371
+ /**
1372
+ * Command name
1373
+ * @example 'build'
1374
+ */
1375
+ readonly name: string;
1376
+ /**
1377
+ * Duration in seconds
1378
+ */
1379
+ readonly durationInSeconds: number;
1380
+ /**
1381
+ * The result of the command
1382
+ */
1383
+ readonly result: 'Succeeded' | 'Failed';
1384
+ /**
1385
+ * The timestamp of the telemetry logging
1386
+ * @example 1648001893024
1387
+ */
1388
+ readonly timestamp?: number;
1389
+ /**
1390
+ * The platform the command was executed on, reads from process.platform
1391
+ * @example darwin, win32, linux...
1392
+ */
1393
+ readonly platform?: string;
1394
+ /**
1395
+ * The rush version
1396
+ * @example 5.63.0
1397
+ */
1398
+ readonly rushVersion?: string;
1399
+ readonly extraData?: {
1400
+ [key: string]: string;
1401
+ };
1402
+ }
1403
+
1360
1404
  /**
1361
1405
  * Options for `RushConfiguration.tryFindRushJsonLocation`.
1362
1406
  * @public
@@ -2103,8 +2147,8 @@ export declare class RushConfiguration {
2103
2147
  private _telemetryEnabled;
2104
2148
  private _projects;
2105
2149
  private _projectsByName;
2106
- private _commonVersionsConfigurations;
2107
- private _implicitlyPreferredVersions;
2150
+ private _projectsByTag;
2151
+ private _commonVersionsConfigurationsByVariant;
2108
2152
  private _versionPolicyConfiguration;
2109
2153
  private _versionPolicyConfigurationFilePath;
2110
2154
  private _experimentsConfiguration;
@@ -2415,6 +2459,11 @@ export declare class RushConfiguration {
2415
2459
  get telemetryEnabled(): boolean;
2416
2460
  get projects(): RushConfigurationProject[];
2417
2461
  get projectsByName(): Map<string, RushConfigurationProject>;
2462
+ /**
2463
+ * Obtains the mapping from custom tags to projects.
2464
+ * @beta
2465
+ */
2466
+ get projectsByTag(): ReadonlyMap<string, ReadonlySet<RushConfigurationProject>>;
2418
2467
  /**
2419
2468
  * {@inheritDoc NpmOptionsConfiguration}
2420
2469
  */
@@ -2546,7 +2595,6 @@ export declare class RushConfiguration {
2546
2595
  * If the path is not under any project's folder, returns undefined.
2547
2596
  */
2548
2597
  tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
2549
- private _collectVersionsForDependencies;
2550
2598
  private _getVariantConfigFolderPath;
2551
2599
  }
2552
2600
 
@@ -2572,6 +2620,7 @@ export declare class RushConfigurationProject {
2572
2620
  private readonly _skipRushCheck;
2573
2621
  private readonly _publishFolder;
2574
2622
  private readonly _rushConfiguration;
2623
+ private readonly _tags;
2575
2624
  private _versionPolicy;
2576
2625
  private _dependencyProjects;
2577
2626
  private _consumingProjects;
@@ -2719,6 +2768,11 @@ export declare class RushConfigurationProject {
2719
2768
  * @beta
2720
2769
  */
2721
2770
  get isMainProject(): boolean;
2771
+ /**
2772
+ * The set of tags applied to this project.
2773
+ * @beta
2774
+ */
2775
+ get tags(): ReadonlySet<string>;
2722
2776
  }
2723
2777
 
2724
2778
  /**
@@ -2984,6 +3038,10 @@ export declare class RushLifecycleHooks {
2984
3038
  * A hook map to allow plugins to hook specific named phased commands (defined in command-line.json) before execution.
2985
3039
  */
2986
3040
  runPhasedCommand: HookMap<AsyncSeriesHook<IPhasedCommand>>;
3041
+ /**
3042
+ * A hook to allow plugins to hook custom logic to process telemetry data.
3043
+ */
3044
+ flushTelemetry: AsyncParallelHook<[ReadonlyArray<ITelemetryData>]>;
2987
3045
  }
2988
3046
 
2989
3047
  declare class RushPluginsConfiguration {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-sdk",
3
- "version": "5.64.0",
3
+ "version": "5.66.0",
4
4
  "description": "An API for interacting with the Rush engine",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,18 +12,18 @@
12
12
  "typings": "dist/rush-lib.d.ts",
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@rushstack/node-core-library": "3.45.1",
15
+ "@rushstack/node-core-library": "3.45.2",
16
16
  "@types/node-fetch": "1.6.9",
17
17
  "tapable": "2.2.1"
18
18
  },
19
19
  "devDependencies": {
20
- "@microsoft/rush-lib": "5.64.0",
21
- "@rushstack/eslint-config": "2.5.2",
22
- "@rushstack/heft": "0.44.5",
23
- "@rushstack/heft-node-rig": "1.8.3",
24
- "@rushstack/stream-collator": "4.0.160",
25
- "@rushstack/ts-command-line": "4.10.7",
26
- "@rushstack/terminal": "0.3.29",
20
+ "@microsoft/rush-lib": "5.66.0",
21
+ "@rushstack/eslint-config": "2.5.3",
22
+ "@rushstack/heft": "0.44.8",
23
+ "@rushstack/heft-node-rig": "1.8.6",
24
+ "@rushstack/stream-collator": "4.0.163",
25
+ "@rushstack/ts-command-line": "4.10.8",
26
+ "@rushstack/terminal": "0.3.32",
27
27
  "@types/heft-jest": "1.0.1",
28
28
  "@types/semver": "7.3.5",
29
29
  "@types/webpack-env": "1.13.0"
@@ -33,5 +33,5 @@
33
33
  "_phase:build": "heft build --clean",
34
34
  "_phase:test": "heft test --no-build"
35
35
  },
36
- "readme": "## @rushstack/rush-sdk\n\nThis is a companion package for the Rush tool. See the [@microsoft/rush](https://www.npmjs.com/package/@microsoft/rush) package for details.\n\n⚠ ***THIS PACKAGE IS EXPERIMENTAL*** ⚠\n\nThe **@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:\n\n1. 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.\n\n2. 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.\n\n3. 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.\n\n\nThe **@rushstack/rush-sdk** API declarations are identical to the corresponding version of **@microsoft/rush-lib**.\n\n## Debugging\n\nVerbose logging can be turn on by set environment variable `RUSH_SDK_DEBUG` to `1`\n\n\n## Links\n\n- [CHANGELOG.md](\n https://github.com/microsoft/rushstack/blob/master/apps/rush/CHANGELOG.md) - Find\n out what's new in the latest version\n- [API Reference](https://rushstack.io/pages/api/rush-lib/)\n\nRush is part of the [Rush Stack](https://rushstack.io/) family of projects.\n"
36
+ "readme": "## @rushstack/rush-sdk\n\nThis is a companion package for the Rush tool. See the [@microsoft/rush](https://www.npmjs.com/package/@microsoft/rush) package for details.\n\n⚠ ***THIS PACKAGE IS EXPERIMENTAL*** ⚠\n\nThe **@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:\n\n1. 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.\n\n2. 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.\n\n3. 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.\n\n\nThe **@rushstack/rush-sdk** API declarations are identical to the corresponding version of **@microsoft/rush-lib**.\n\n## Debugging\n\nVerbose logging can be turn on by set environment variable `RUSH_SDK_DEBUG` to `1`\n\n\n## Links\n\n- [CHANGELOG.md](\n https://github.com/microsoft/rushstack/blob/main/apps/rush/CHANGELOG.md) - Find\n out what's new in the latest version\n- [API Reference](https://api.rushstack.io/pages/rush-lib/)\n\nRush is part of the [Rush Stack](https://rushstack.io/) family of projects.\n"
37
37
  }