Skip to content

Commit

Permalink
Update types.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Oct 8, 2023
1 parent e161f20 commit 89f4262
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 17 deletions.
6 changes: 6 additions & 0 deletions .yarn/versions/22a0caa2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ releases:
'@moonrepo/core-macos-x64': minor
'@moonrepo/core-windows-x64-msvc': minor
'@moonrepo/visualizer': minor
'@moonrepo/types': minor
'@moonrepo/report': minor

declined:
- '@moonrepo/runtime'
- website
1 change: 1 addition & 0 deletions nextgen/action-graph/src/action_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use serde::Serialize;
use std::hash::{Hash, Hasher};

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
#[serde(tag = "action", content = "params")]
pub enum ActionNode {
/// Install tool dependencies in the workspace root.
InstallDeps { runtime: Runtime },
Expand Down
1 change: 1 addition & 0 deletions nextgen/platform-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::fmt;
use std::hash::{Hash, Hasher};

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
#[serde(untagged)]
pub enum RuntimeReq {
// Use tool available on PATH
Global,
Expand Down
5 changes: 3 additions & 2 deletions packages/types/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface Duration {
}

export interface Runtime {
platform: Capitalize<PlatformType>;
version?: string;
platform: PlatformType;
requirement?: string;
overridden?: boolean;
}
46 changes: 31 additions & 15 deletions packages/types/src/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface Attempt {
}

export interface Action {
allowFailure?: boolean;
attempts: Attempt[] | null;
createdAt: string;
duration: Duration | null;
Expand Down Expand Up @@ -75,37 +76,52 @@ export interface RunReport {
export type ActionNode =
| ActionNodeInstallDeps
| ActionNodeInstallProjectDeps
| ActionNodeRunPersistentTarget
| ActionNodeRunTarget
| ActionNodeRunTask
| ActionNodeSetupTool
| ActionNodeSyncProject;
| ActionNodeSyncProject
| ActionNodeSyncWorkspace;

export interface ActionNodeInstallDeps {
action: 'InstallDeps';
params: Runtime;
params: {
runtime: Runtime;
};
}

export interface ActionNodeInstallProjectDeps {
action: 'InstallProjectDeps';
params: [Runtime, string];
}

export interface ActionNodeRunTarget {
action: 'RunTarget';
params: [Runtime, string];
params: {
runtime: Runtime;
project: string;
};
}

export interface ActionNodeRunPersistentTarget {
action: 'RunPersistentTarget';
params: [Runtime, string];
export interface ActionNodeRunTask {
action: 'RunTask';
params: {
interactive: boolean;
persistent: boolean;
runtime: Runtime;
target: string;
};
}

export interface ActionNodeSetupTool {
action: 'SetupTool';
params: Runtime;
params: {
runtime: Runtime;
};
}

export interface ActionNodeSyncProject {
action: 'SyncProject';
params: [Runtime, string];
params: {
runtime: Runtime;
project: string;
};
}

export interface ActionNodeSyncWorkspace {
action: 'SyncWorkspace';
params: {};
}

0 comments on commit 89f4262

Please sign in to comment.