Skip to content

Commit

Permalink
feat(compas): add inferred 'dev', 'lint' and 'test' actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkdev98 committed Sep 9, 2023
1 parent 471ebe7 commit 59bb358
Show file tree
Hide file tree
Showing 11 changed files with 608 additions and 36 deletions.
10 changes: 0 additions & 10 deletions config/compas.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@
"shortcut": "D",
"command": ["npx", "compas", "run", "docs:dev"]
},
{
"name": "Lint",
"shortcut": "L",
"command": ["npx", "compas", "lint"]
},
{
"name": "Test",
"shortcut": "T",
"command": ["npx", "compas", "test"]
},
{
"name": "Generate",
"shortcut": "G",
Expand Down
13 changes: 13 additions & 0 deletions gen/compas.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ export function applyCompasStructure(generator) {
.docs(
"The inferred package manager per rootDirectory. Managed by {@link PackageManagerIntegration}.",
),

availableActions: T.generic()
.keys(T.string())
.values([
{
name: T.string(),
command: [T.string()],
},
])
.optional()
.docs(
"Shared available actions per rootDirectory. Managed by {@link InferredActionIntegration}.",
),
}),
);
}
77 changes: 77 additions & 0 deletions packages/compas/src/generated/common/structure.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,83 @@
}
}
}
},
"availableActions": {
"docString": "Shared available actions per rootDirectory. Managed by {@link InferredActionIntegration}.",
"isOptional": true,
"validator": {},
"sql": {},
"type": "generic",
"keys": {
"docString": "",
"isOptional": false,
"validator": {
"allowNull": false,
"trim": false,
"lowerCase": false,
"upperCase": false,
"min": 1
},
"sql": {},
"type": "string"
},
"values": {
"docString": "",
"isOptional": false,
"validator": {
"convert": false
},
"sql": {},
"type": "array",
"values": {
"docString": "",
"isOptional": false,
"validator": {
"allowNull": false,
"strict": true
},
"sql": {},
"type": "object",
"relations": [],
"keys": {
"name": {
"docString": "",
"isOptional": false,
"validator": {
"allowNull": false,
"trim": false,
"lowerCase": false,
"upperCase": false,
"min": 1
},
"sql": {},
"type": "string"
},
"command": {
"docString": "",
"isOptional": false,
"validator": {
"convert": false
},
"sql": {},
"type": "array",
"values": {
"docString": "",
"isOptional": false,
"validator": {
"allowNull": false,
"trim": false,
"lowerCase": false,
"upperCase": false,
"min": 1
},
"sql": {},
"type": "string"
}
}
}
}
}
}
}
},
Expand Down
16 changes: 16 additions & 0 deletions packages/compas/src/generated/common/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ export type CompasCache = {
"nodeModulesBinCommand": string;
"packageJsonScriptCommand": string;
}}|undefined;

/**
* Shared available actions per rootDirectory. Managed by {@link InferredActionIntegration}.
*/
"availableActions"?: { [key: string]: ({
"name": string;
"command": (string)[];
})[]}|undefined;
};

export type CompasResolvedConfigInput = {
Expand Down Expand Up @@ -147,6 +155,14 @@ export type CompasCacheInput = {
"nodeModulesBinCommand": string;
"packageJsonScriptCommand": string;
}}|undefined;

/**
* Shared available actions per rootDirectory. Managed by {@link InferredActionIntegration}.
*/
"availableActions"?: { [key: string]: ({
"name": string;
"command": (string)[];
})[]}|undefined;
};

export type CompasConfig = {
Expand Down
Loading

0 comments on commit 59bb358

Please sign in to comment.