Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "[rush-serve-plugin] Support aborting execution via Web Socket. Include information about the dependencies of operations in messages to the client..",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,9 @@ import { Async } from '@rushstack/node-core-library';
import type { ITerminal } from '@rushstack/terminal';
import { RigConfig } from '@rushstack/rig-package';
import type { RushConfigurationProject } from '@rushstack/rush-sdk';
import rushProjectServeSchema from './schemas/rush-project-serve.schema.json';

export interface IRushProjectServeJson {
routing: IRoutingRuleJson[];
}

export interface IBaseRoutingRuleJson {
servePath: string;
immutable?: boolean;
}

export interface IRoutingFolderRuleJson extends IBaseRoutingRuleJson {
projectRelativeFile: undefined;
projectRelativeFolder: string;
}

export interface IRoutingFileRuleJson extends IBaseRoutingRuleJson {
projectRelativeFile: string;
projectRelativeFolder: undefined;
}

export type IRoutingRuleJson = IRoutingFileRuleJson | IRoutingFolderRuleJson;

export interface IRoutingRule {
type: 'file' | 'folder';
diskPath: string;
servePath: string;
immutable: boolean;
}
import rushProjectServeSchema from './schemas/rush-project-serve.schema.json';
import type { IRushProjectServeJson, IRoutingRule } from './types';

export class RushServeConfiguration {
private readonly _loader: ProjectConfigurationFile<IRushProjectServeJson>;
Expand Down
2 changes: 1 addition & 1 deletion rush-plugins/rush-serve-plugin/src/RushServePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as path from 'path';
import type { IRushPlugin, RushSession, RushConfiguration, IPhasedCommand } from '@rushstack/rush-sdk';
import { PLUGIN_NAME } from './constants';

import type { IBaseRoutingRuleJson, IRoutingRule } from './RushProjectServeConfigFile';
import type { IBaseRoutingRuleJson, IRoutingRule } from './types';

export interface IGlobalRoutingFolderRuleJson extends IBaseRoutingRuleJson {
workspaceRelativeFile: undefined;
Expand Down
15 changes: 14 additions & 1 deletion rush-plugins/rush-serve-plugin/src/api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ export interface IOperationInfo {
*/
name: string;

/**
* The names of the dependencies of the operation.
*/
dependencies: string[];

/**
* The npm package name of the containing Rush Project.
*/
Expand Down Expand Up @@ -151,6 +156,13 @@ export interface IWebSocketSyncCommandMessage {
command: 'sync';
}

/**
* Message received from a WebSocket client to request abortion of the current execution pass.
*/
export interface IWebSocketAbortExecutionCommandMessage {
command: 'abort-execution';
}

/**
* Message received from a WebSocket client to request invalidation of one or more operations.
*/
Expand All @@ -162,7 +174,7 @@ export interface IWebSocketInvalidateCommandMessage {
/**
* The set of possible operation enabled states.
*/
export type OperationEnabledState = 'never' | 'changed' | 'affected';
export type OperationEnabledState = 'never' | 'changed' | 'affected' | 'default';

/**
* Message received from a WebSocket client to change the enabled states of operations.
Expand All @@ -177,5 +189,6 @@ export interface IWebSocketSetEnabledStatesCommandMessage {
*/
export type IWebSocketCommandMessage =
| IWebSocketSyncCommandMessage
| IWebSocketAbortExecutionCommandMessage
| IWebSocketInvalidateCommandMessage
| IWebSocketSetEnabledStatesCommandMessage;
Loading
Loading