-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Overview
Today all configurations of targets needs to be defined in lage.config (or through cosmiconfig in the package.json at the root of the monorepo)
In large repo's this can become cumbersome to maintain centrally. It would be better if this was implemented a bit closer to where it would be needed like in the package.json file of the package.
Detailed Design
We allow package.json to have a field 'lage' (similar to how we allow it through cosmiconfig in the root package.json.
In that location we would allow a value of type PipelineDefinition. These values would not be be identical.
So instead of having
"@lage-run/e2e-tests#test": {
"type": "npmScript",
"dependsOn": ["^^transpile", "lage#bundle"],
},One can update the package.json for this package
{
"name": "@lage-run/e2e-tests",
"version": "0.1.0",
"description": "End to End Tests for Lage",
...
"lage": {
"test": {
"type": "npmScript",
"dependsOn": ["^^transpile", "lage#bundle"],
},
}
}When the pipeline definitions are included in the main configuration object, we would prepend the package name. I.e. the example above would be identical. globally the key would be @lage-run/e2e-tests#test.
Implementation Plan
- Extend function
createTargetGraphin CreateTargetGraph.ts . - At the end of the function we'll loop over packageInfo's extract the
lagefield. - For each pipeline rule, update the name by prepending the
packageInfo.nameand a# - Call
builder.addTargetConfig
Test Plan
Vanilla unittests
Performance, Resilience, Monitoring
There should be no major perf impact because all packages are already read and loaded.