Skip to content

Commit 59bb358

Browse files
committed
feat(compas): add inferred 'dev', 'lint' and 'test' actions
1 parent 471ebe7 commit 59bb358

File tree

11 files changed

+608
-36
lines changed

11 files changed

+608
-36
lines changed

config/compas.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@
1212
"shortcut": "D",
1313
"command": ["npx", "compas", "run", "docs:dev"]
1414
},
15-
{
16-
"name": "Lint",
17-
"shortcut": "L",
18-
"command": ["npx", "compas", "lint"]
19-
},
20-
{
21-
"name": "Test",
22-
"shortcut": "T",
23-
"command": ["npx", "compas", "test"]
24-
},
2515
{
2616
"name": "Generate",
2717
"shortcut": "G",

gen/compas.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ export function applyCompasStructure(generator) {
102102
.docs(
103103
"The inferred package manager per rootDirectory. Managed by {@link PackageManagerIntegration}.",
104104
),
105+
106+
availableActions: T.generic()
107+
.keys(T.string())
108+
.values([
109+
{
110+
name: T.string(),
111+
command: [T.string()],
112+
},
113+
])
114+
.optional()
115+
.docs(
116+
"Shared available actions per rootDirectory. Managed by {@link InferredActionIntegration}.",
117+
),
105118
}),
106119
);
107120
}

packages/compas/src/generated/common/structure.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,83 @@
154154
}
155155
}
156156
}
157+
},
158+
"availableActions": {
159+
"docString": "Shared available actions per rootDirectory. Managed by {@link InferredActionIntegration}.",
160+
"isOptional": true,
161+
"validator": {},
162+
"sql": {},
163+
"type": "generic",
164+
"keys": {
165+
"docString": "",
166+
"isOptional": false,
167+
"validator": {
168+
"allowNull": false,
169+
"trim": false,
170+
"lowerCase": false,
171+
"upperCase": false,
172+
"min": 1
173+
},
174+
"sql": {},
175+
"type": "string"
176+
},
177+
"values": {
178+
"docString": "",
179+
"isOptional": false,
180+
"validator": {
181+
"convert": false
182+
},
183+
"sql": {},
184+
"type": "array",
185+
"values": {
186+
"docString": "",
187+
"isOptional": false,
188+
"validator": {
189+
"allowNull": false,
190+
"strict": true
191+
},
192+
"sql": {},
193+
"type": "object",
194+
"relations": [],
195+
"keys": {
196+
"name": {
197+
"docString": "",
198+
"isOptional": false,
199+
"validator": {
200+
"allowNull": false,
201+
"trim": false,
202+
"lowerCase": false,
203+
"upperCase": false,
204+
"min": 1
205+
},
206+
"sql": {},
207+
"type": "string"
208+
},
209+
"command": {
210+
"docString": "",
211+
"isOptional": false,
212+
"validator": {
213+
"convert": false
214+
},
215+
"sql": {},
216+
"type": "array",
217+
"values": {
218+
"docString": "",
219+
"isOptional": false,
220+
"validator": {
221+
"allowNull": false,
222+
"trim": false,
223+
"lowerCase": false,
224+
"upperCase": false,
225+
"min": 1
226+
},
227+
"sql": {},
228+
"type": "string"
229+
}
230+
}
231+
}
232+
}
233+
}
157234
}
158235
}
159236
},

packages/compas/src/generated/common/types.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ export type CompasCache = {
7373
"nodeModulesBinCommand": string;
7474
"packageJsonScriptCommand": string;
7575
}}|undefined;
76+
77+
/**
78+
* Shared available actions per rootDirectory. Managed by {@link InferredActionIntegration}.
79+
*/
80+
"availableActions"?: { [key: string]: ({
81+
"name": string;
82+
"command": (string)[];
83+
})[]}|undefined;
7684
};
7785

7886
export type CompasResolvedConfigInput = {
@@ -147,6 +155,14 @@ export type CompasCacheInput = {
147155
"nodeModulesBinCommand": string;
148156
"packageJsonScriptCommand": string;
149157
}}|undefined;
158+
159+
/**
160+
* Shared available actions per rootDirectory. Managed by {@link InferredActionIntegration}.
161+
*/
162+
"availableActions"?: { [key: string]: ({
163+
"name": string;
164+
"command": (string)[];
165+
})[]}|undefined;
150166
};
151167

152168
export type CompasConfig = {

0 commit comments

Comments
 (0)