@moonrepo/types 1.33.2 → 2.0.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/src/project.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Id } from './common';
1
+ import type { GraphContainer, Id } from './common';
2
2
  import type {
3
3
  DependencyScope,
4
4
  LanguageType,
@@ -7,23 +7,7 @@ import type {
7
7
  ProjectDependencyConfig,
8
8
  StackType,
9
9
  } from './project-config';
10
- import type {
11
- InheritedTasksConfig,
12
- Input,
13
- Output,
14
- PartialInheritedTasksConfig,
15
- PlatformType,
16
- TaskDependencyConfig,
17
- TaskDependencyType,
18
- TaskMergeStrategy,
19
- TaskOperatingSystem,
20
- TaskOutputStyle,
21
- TaskPreset,
22
- TaskPriority,
23
- TaskType,
24
- TaskUnixShell,
25
- TaskWindowsShell,
26
- } from './tasks-config';
10
+ import type { InheritedTasks, Task } from './task';
27
11
 
28
12
  export interface FileGroup {
29
13
  env: string[];
@@ -32,105 +16,20 @@ export interface FileGroup {
32
16
  id: Id;
33
17
  }
34
18
 
35
- export interface TaskOptions {
36
- affectedFiles?: boolean | 'args' | 'env' | null;
37
- affectedPassInputs: boolean;
38
- allowFailure: boolean;
39
- cache: boolean;
40
- cacheKey?: string | null;
41
- cacheLifetime?: string | null;
42
- envFiles?: string[] | null;
43
- inferInputs: boolean;
44
- internal: boolean;
45
- interactive: boolean;
46
- mergeArgs: TaskMergeStrategy;
47
- mergeDeps: TaskMergeStrategy;
48
- mergeEnv: TaskMergeStrategy;
49
- mergeInputs: TaskMergeStrategy;
50
- mergeOutputs: TaskMergeStrategy;
51
- mutex?: string | null;
52
- os?: TaskOperatingSystem[] | null;
53
- outputStyle?: TaskOutputStyle | null;
54
- persistent: boolean;
55
- priority: TaskPriority;
56
- retryCount: number;
57
- runDepsInParallel: boolean;
58
- runInCI: boolean;
59
- runFromWorkspaceRoot: boolean;
60
- shell?: boolean | null;
61
- timeout?: number | null;
62
- unixShell?: TaskUnixShell | null;
63
- windowsShell?: TaskWindowsShell | null;
64
- }
65
-
66
- export interface TaskState {
67
- defaultInputs?: boolean;
68
- emptyInputs?: boolean;
69
- expanded?: boolean;
70
- localOnly?: boolean;
71
- rootLevel?: boolean;
72
- }
73
-
74
- export interface TaskFileInput {
75
- content?: string | null;
76
- optional?: boolean | null;
77
- }
78
-
79
- export interface TaskGlobInput {
80
- cache?: boolean;
81
- }
82
-
83
- export interface TaskFileOutput {
84
- optional?: boolean;
85
- }
86
-
87
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
88
- export interface TaskGlobOutput {}
89
-
90
- export interface Task {
91
- args?: string[];
92
- command: string;
93
- deps?: TaskDependencyConfig[];
94
- description?: string | null;
95
- env?: Record<string, string>;
96
- id: Id;
97
- inputs?: Input[];
98
- inputEnv?: string[];
99
- inputFiles?: Record<string, TaskFileInput>;
100
- inputGlobs?: Record<string, TaskGlobInput>;
101
- options: TaskOptions;
102
- outputs?: Output[];
103
- outputFiles?: Record<string, TaskFileOutput>;
104
- outputGlobs?: Record<string, TaskGlobOutput>;
105
- platform: PlatformType;
106
- preset?: TaskPreset | null;
107
- script?: string | null;
108
- state: TaskState;
109
- target: string;
110
- toolchains?: Id[];
111
- type: TaskType;
112
- }
113
-
114
- export interface TaskFragment {
115
- target: string;
116
- toolchains?: Id[];
19
+ export interface ProjectAlias {
20
+ alias: string;
21
+ plugin: Id;
117
22
  }
118
23
 
119
24
  export interface Project {
120
- alias?: string | null;
25
+ aliases?: ProjectAlias[] | null;
121
26
  config: ProjectConfig;
122
27
  dependencies?: ProjectDependencyConfig[];
123
28
  fileGroups?: Record<string, FileGroup>;
124
29
  id: Id;
125
- inherited?: {
126
- order: string[];
127
- config: InheritedTasksConfig;
128
- layers: Record<string, PartialInheritedTasksConfig>;
129
- taskLayers: Record<string, string[]>;
130
- } | null;
30
+ inherited?: InheritedTasks | null;
131
31
  language: LanguageType;
132
32
  layer: LayerType;
133
- platform: PlatformType;
134
33
  root: string;
135
34
  source: string;
136
35
  stack: StackType;
@@ -147,35 +46,4 @@ export interface ProjectFragment {
147
46
  toolchains?: Id[];
148
47
  }
149
48
 
150
- export interface ProjectGraphInner {
151
- nodes: Project[];
152
- node_holes: string[];
153
- edge_property: 'directed';
154
- edges: [number, number, DependencyScope][];
155
- }
156
-
157
- export interface ProjectGraph {
158
- graph: ProjectGraphInner;
159
- }
160
-
161
- export interface TaskGraphInner {
162
- nodes: Task[];
163
- node_holes: string[];
164
- edge_property: 'directed';
165
- edges: [number, number, TaskDependencyType][];
166
- }
167
-
168
- export interface TaskGraph {
169
- graph: TaskGraphInner;
170
- }
171
-
172
- export interface WorkspaceGraph {
173
- projects_by_tag: Record<string, string[]>;
174
- project_data: Record<string, { alias: string; node_index: number; source: string }>;
175
- project_graph: ProjectGraphInner;
176
- renamed_project_ids: Record<string, string>;
177
- repo_type: 'monorepo-with-root' | 'monorepo' | 'polyrepo';
178
- root_project_id: Id | null;
179
- task_data: Record<string, { node_index: number }>;
180
- task_graph: TaskGraphInner;
181
- }
49
+ export type ProjectGraph = GraphContainer<Project, DependencyScope>;
package/src/task.ts ADDED
@@ -0,0 +1,106 @@
1
+ import type { GraphContainer, Id } from './common';
2
+ import type {
3
+ InheritedTasksConfig,
4
+ Input,
5
+ Output,
6
+ TaskDependencyConfig,
7
+ TaskDependencyType,
8
+ TaskMergeStrategy,
9
+ TaskOperatingSystem,
10
+ TaskOutputStyle,
11
+ TaskPreset,
12
+ TaskPriority,
13
+ TaskType,
14
+ TaskUnixShell,
15
+ TaskWindowsShell,
16
+ } from './tasks-config';
17
+
18
+ export interface InheritedTasks {
19
+ configs: Record<string, InheritedTasksConfig>;
20
+ layers: Record<string, string[]>;
21
+ }
22
+
23
+ export interface TaskOptions {
24
+ affectedFiles?: boolean | 'args' | 'env' | null;
25
+ affectedPassInputs: boolean;
26
+ allowFailure: boolean;
27
+ cache: boolean | 'local' | 'remote';
28
+ cacheKey?: string | null;
29
+ cacheLifetime?: string | null;
30
+ envFiles?: string[] | null;
31
+ inferInputs: boolean;
32
+ internal: boolean;
33
+ interactive: boolean;
34
+ mergeArgs: TaskMergeStrategy;
35
+ mergeDeps: TaskMergeStrategy;
36
+ mergeEnv: TaskMergeStrategy;
37
+ mergeInputs: TaskMergeStrategy;
38
+ mergeOutputs: TaskMergeStrategy;
39
+ mergeToolchains: TaskMergeStrategy;
40
+ mutex?: string | null;
41
+ os?: TaskOperatingSystem[] | null;
42
+ outputStyle?: TaskOutputStyle | null;
43
+ persistent: boolean;
44
+ priority: TaskPriority;
45
+ retryCount: number;
46
+ runDepsInParallel: boolean;
47
+ runInCI: boolean;
48
+ runFromWorkspaceRoot: boolean;
49
+ shell?: boolean | null;
50
+ timeout?: number | null;
51
+ unixShell?: TaskUnixShell | null;
52
+ windowsShell?: TaskWindowsShell | null;
53
+ }
54
+
55
+ export interface TaskState {
56
+ defaultInputs?: boolean;
57
+ emptyInputs?: boolean;
58
+ expanded?: boolean;
59
+ rootLevel?: boolean;
60
+ }
61
+
62
+ export interface TaskFileInput {
63
+ content?: string | null;
64
+ optional?: boolean | null;
65
+ }
66
+
67
+ export interface TaskGlobInput {
68
+ cache?: boolean;
69
+ }
70
+
71
+ export interface TaskFileOutput {
72
+ optional?: boolean;
73
+ }
74
+
75
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
76
+ export interface TaskGlobOutput {}
77
+
78
+ export interface Task {
79
+ args?: string[];
80
+ command: string;
81
+ deps?: TaskDependencyConfig[];
82
+ description?: string | null;
83
+ env?: Record<string, string>;
84
+ id: Id;
85
+ inputs?: Input[];
86
+ inputEnv?: string[];
87
+ inputFiles?: Record<string, TaskFileInput>;
88
+ inputGlobs?: Record<string, TaskGlobInput>;
89
+ options: TaskOptions;
90
+ outputs?: Output[];
91
+ outputFiles?: Record<string, TaskFileOutput>;
92
+ outputGlobs?: Record<string, TaskGlobOutput>;
93
+ preset?: TaskPreset | null;
94
+ script?: string | null;
95
+ state: TaskState;
96
+ target: string;
97
+ toolchains?: Id[];
98
+ type: TaskType;
99
+ }
100
+
101
+ export interface TaskFragment {
102
+ target: string;
103
+ toolchains?: Id[];
104
+ }
105
+
106
+ export type TaskGraph = GraphContainer<Task, TaskDependencyType>;