lage 1.1.2 → 1.3.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/CHANGELOG.json +76 -1
- package/CHANGELOG.md +34 -2
- package/beachball.config.js +17 -0
- package/lib/logger/reporters/NpmLogReporter.js +4 -1
- package/lib/task/Pipeline.d.ts +8 -1
- package/lib/task/Pipeline.js +54 -3
- package/lib/task/WrappedTarget.js +1 -1
- package/lib/types/ConfigOptions.d.ts +4 -1
- package/package.json +3 -3
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,82 @@
|
|
|
2
2
|
"name": "lage",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 07 Jan 2022 21:55:13 GMT",
|
|
6
|
+
"tag": "lage_v1.3.0",
|
|
7
|
+
"version": "1.3.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "kchau@microsoft.com",
|
|
12
|
+
"package": "lage",
|
|
13
|
+
"comment": "speeding up by bumping backfill & workspace-tools. now supports npm 7",
|
|
14
|
+
"commit": "48de07b8d01b1be7a00b13e0f099231e9cc768c4"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Mon, 03 Jan 2022 23:13:44 GMT",
|
|
21
|
+
"tag": "lage_v1.2.0",
|
|
22
|
+
"version": "1.2.0",
|
|
23
|
+
"comments": {
|
|
24
|
+
"minor": [
|
|
25
|
+
{
|
|
26
|
+
"author": "mhuan13@gmail.com",
|
|
27
|
+
"package": "lage",
|
|
28
|
+
"comment": "Allow explicit parralel scheduling of transitive dependencies with ^^ prefix",
|
|
29
|
+
"commit": "c3c1c7378f5fdc1e77fbe1aad38627d5d23a8d30"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Sat, 04 Dec 2021 00:24:11 GMT",
|
|
36
|
+
"tag": "lage_v1.1.4",
|
|
37
|
+
"version": "1.1.4",
|
|
38
|
+
"comments": {
|
|
39
|
+
"patch": [
|
|
40
|
+
{
|
|
41
|
+
"author": "ken@gizzar.com",
|
|
42
|
+
"package": "lage",
|
|
43
|
+
"comment": "fixes the tasks that have the package in its id",
|
|
44
|
+
"commit": "95affe7fc481d92940dd7b9f11a40051fc320865"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "Thu, 02 Dec 2021 22:25:07 GMT",
|
|
51
|
+
"tag": "lage_v1.1.3",
|
|
52
|
+
"version": "1.1.3",
|
|
53
|
+
"comments": {
|
|
54
|
+
"none": [
|
|
55
|
+
{
|
|
56
|
+
"author": "4123478+tido64@users.noreply.github.com",
|
|
57
|
+
"package": "lage",
|
|
58
|
+
"comment": "Disable GPG signing in tests to ensure it won't fail",
|
|
59
|
+
"commit": "8198557e7a36803d736ae3b5c816166389ba30a7"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"date": "Thu, 02 Dec 2021 20:21:01 GMT",
|
|
66
|
+
"tag": "lage_v1.1.3",
|
|
67
|
+
"version": "1.1.3",
|
|
68
|
+
"comments": {
|
|
69
|
+
"patch": [
|
|
70
|
+
{
|
|
71
|
+
"author": "elcraig@microsoft.com",
|
|
72
|
+
"package": "lage",
|
|
73
|
+
"comment": "Prevent truncation of error summary logs",
|
|
74
|
+
"commit": "defd554aa2e4a330f865b41b78792a35a831ea64"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"date": "Wed, 01 Dec 2021 19:18:41 GMT",
|
|
6
81
|
"tag": "lage_v1.1.2",
|
|
7
82
|
"version": "1.1.2",
|
|
8
83
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
# Change Log - lage
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 07 Jan 2022 21:55:13 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.3.0
|
|
8
|
+
|
|
9
|
+
Fri, 07 Jan 2022 21:55:13 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- speeding up by bumping backfill & workspace-tools. now supports npm 7 (kchau@microsoft.com)
|
|
14
|
+
|
|
15
|
+
## 1.2.0
|
|
16
|
+
|
|
17
|
+
Mon, 03 Jan 2022 23:13:44 GMT
|
|
18
|
+
|
|
19
|
+
### Minor changes
|
|
20
|
+
|
|
21
|
+
- Allow explicit parralel scheduling of transitive dependencies with ^^ prefix (mhuan13@gmail.com)
|
|
22
|
+
|
|
23
|
+
## 1.1.4
|
|
24
|
+
|
|
25
|
+
Sat, 04 Dec 2021 00:24:11 GMT
|
|
26
|
+
|
|
27
|
+
### Patches
|
|
28
|
+
|
|
29
|
+
- fixes the tasks that have the package in its id (ken@gizzar.com)
|
|
30
|
+
|
|
31
|
+
## 1.1.3
|
|
32
|
+
|
|
33
|
+
Thu, 02 Dec 2021 20:21:01 GMT
|
|
34
|
+
|
|
35
|
+
### Patches
|
|
36
|
+
|
|
37
|
+
- Prevent truncation of error summary logs (elcraig@microsoft.com)
|
|
38
|
+
|
|
7
39
|
## 1.1.2
|
|
8
40
|
|
|
9
|
-
Wed, 01 Dec 2021 19:18:
|
|
41
|
+
Wed, 01 Dec 2021 19:18:41 GMT
|
|
10
42
|
|
|
11
43
|
### Patches
|
|
12
44
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
/** @type {import('beachball').BeachballConfig}*/
|
|
3
|
+
module.exports = {
|
|
4
|
+
ignorePatterns: [
|
|
5
|
+
'.*ignore',
|
|
6
|
+
'.github/**',
|
|
7
|
+
'beachball.config.js',
|
|
8
|
+
'decks/**',
|
|
9
|
+
'docs/**',
|
|
10
|
+
'jasmine.json',
|
|
11
|
+
'jest.config.js',
|
|
12
|
+
'renovate.json',
|
|
13
|
+
'tests/**',
|
|
14
|
+
// This one is especially important (otherwise dependabot would be blocked by change file requirements)
|
|
15
|
+
'yarn.lock',
|
|
16
|
+
],
|
|
17
|
+
};
|
|
@@ -158,7 +158,10 @@ class NpmLogReporter {
|
|
|
158
158
|
const taskLogs = (_a = targets.get(failedTargetId)) === null || _a === void 0 ? void 0 : _a.logger.getLogs();
|
|
159
159
|
npmlog_1.default.error("", `[${chalk_1.default.magenta(packageName)} ${chalk_1.default.cyan(task)}] ${chalk_1.default.redBright("ERROR DETECTED")}`);
|
|
160
160
|
if (taskLogs) {
|
|
161
|
-
|
|
161
|
+
for (const entry of taskLogs) {
|
|
162
|
+
// Log each entry separately to prevent truncation
|
|
163
|
+
npmlog_1.default.error("", entry.msg);
|
|
164
|
+
}
|
|
162
165
|
}
|
|
163
166
|
hr();
|
|
164
167
|
}
|
package/lib/task/Pipeline.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare const START_TARGET_ID = "__start";
|
|
|
14
14
|
export declare class Pipeline {
|
|
15
15
|
private workspace;
|
|
16
16
|
private config;
|
|
17
|
+
private cachedTransitiveTaskDependencies;
|
|
17
18
|
/** Target represent a unit of work and the configuration of how to run it */
|
|
18
19
|
targets: Map<string, PipelineTarget>;
|
|
19
20
|
/** Target dependencies determine the run order of the targets */
|
|
@@ -48,7 +49,7 @@ export declare class Pipeline {
|
|
|
48
49
|
*/
|
|
49
50
|
private generateFactoryTargets;
|
|
50
51
|
/**
|
|
51
|
-
* Converts target configuration to pipeline
|
|
52
|
+
* Converts target configuration to pipeline targets
|
|
52
53
|
* @param id
|
|
53
54
|
* @param target
|
|
54
55
|
*/
|
|
@@ -63,6 +64,12 @@ export declare class Pipeline {
|
|
|
63
64
|
* Adds all the target dependencies to the graph
|
|
64
65
|
*/
|
|
65
66
|
addDependencies(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Gets a list of package names that are direct or indirect dependencies of rootPackageName in this.graph,
|
|
69
|
+
* and caches them on the Pipeline.
|
|
70
|
+
* @param packageName the root package to begin walking from
|
|
71
|
+
*/
|
|
72
|
+
getTransitiveGraphDependencies(packageName: string): Set<string>;
|
|
66
73
|
generateTargetGraph(): [string, string][];
|
|
67
74
|
loadConfig(config: Config): void;
|
|
68
75
|
private getTargetPriority;
|
package/lib/task/Pipeline.js
CHANGED
|
@@ -23,6 +23,7 @@ class Pipeline {
|
|
|
23
23
|
constructor(workspace, config) {
|
|
24
24
|
this.workspace = workspace;
|
|
25
25
|
this.config = config;
|
|
26
|
+
this.cachedTransitiveTaskDependencies = new Map();
|
|
26
27
|
/** Target represent a unit of work and the configuration of how to run it */
|
|
27
28
|
this.targets = new Map([
|
|
28
29
|
[
|
|
@@ -33,6 +34,7 @@ class Pipeline {
|
|
|
33
34
|
run: () => { },
|
|
34
35
|
task: exports.START_TARGET_ID,
|
|
35
36
|
hidden: true,
|
|
37
|
+
cache: false,
|
|
36
38
|
},
|
|
37
39
|
],
|
|
38
40
|
]);
|
|
@@ -127,7 +129,7 @@ class Pipeline {
|
|
|
127
129
|
return Array.isArray(targets) ? targets : [targets];
|
|
128
130
|
}
|
|
129
131
|
/**
|
|
130
|
-
* Converts target configuration to pipeline
|
|
132
|
+
* Converts target configuration to pipeline targets
|
|
131
133
|
* @param id
|
|
132
134
|
* @param target
|
|
133
135
|
*/
|
|
@@ -138,6 +140,13 @@ class Pipeline {
|
|
|
138
140
|
Object.assign(Object.assign({}, target), { id: targetId, cache: target.cache !== false, cwd: this.workspace.root, task: id, run: this.runTask(targetId, this.workspace.root, target.run) || (() => { }) }),
|
|
139
141
|
];
|
|
140
142
|
}
|
|
143
|
+
else if (id.includes("#")) {
|
|
144
|
+
const { packageName: pkg, task } = (0, taskId_1.getPackageAndTask)(id);
|
|
145
|
+
return [
|
|
146
|
+
Object.assign(Object.assign({}, target), { id, cache: target.cache !== false, task: id, cwd: path_1.default.dirname(this.packageInfos[pkg].packageJsonPath), packageName: pkg, run: this.runTask(id, path_1.default.dirname(this.packageInfos[pkg].packageJsonPath), target.run) ||
|
|
147
|
+
this.maybeRunNpmTask(task, this.packageInfos[pkg]) }),
|
|
148
|
+
];
|
|
149
|
+
}
|
|
141
150
|
else {
|
|
142
151
|
const packages = Object.entries(this.packageInfos);
|
|
143
152
|
return packages.map(([pkg, _info]) => {
|
|
@@ -189,6 +198,8 @@ class Pipeline {
|
|
|
189
198
|
* - for any deps like package#task, we simply add the singular dependency (source could be a single package or all packages)
|
|
190
199
|
* - for anything that starts with a "^", we add the package-tasks according to the topological package graph
|
|
191
200
|
* NOTE: in a non-strict mode (TODO), the dependencies can come from transitive task dependencies
|
|
201
|
+
* - for anything that starts with a "^^", we add the package-tasks from the transitive dependencies in the topological
|
|
202
|
+
* package graph.
|
|
192
203
|
* - for {"pkgA#task": ["dep"]}, we interpret to add "pkgA#dep"
|
|
193
204
|
* - for anything that is a string without a "^", we treat that string as the name of a task, adding all targets that way
|
|
194
205
|
* NOTE: in a non-strict mode (TODO), the dependencies can come from transitive task dependencies
|
|
@@ -202,11 +213,13 @@ class Pipeline {
|
|
|
202
213
|
}
|
|
203
214
|
else if (dep.startsWith("^") && packageName) {
|
|
204
215
|
// topo dep -> build: ['^build']
|
|
205
|
-
const depTask = dep.
|
|
216
|
+
const [depTask, dependencySet] = dep.startsWith("^^") ?
|
|
217
|
+
[dep.substr(2), [...this.getTransitiveGraphDependencies(packageName)]]
|
|
218
|
+
: [dep.substr(1), this.graph[packageName].dependencies];
|
|
206
219
|
const dependencyIds = targets
|
|
207
220
|
.filter((needle) => {
|
|
208
221
|
const { task, packageName: needlePackageName } = needle;
|
|
209
|
-
return (task === depTask &&
|
|
222
|
+
return (task === depTask && dependencySet.some((depPkg) => depPkg === needlePackageName));
|
|
210
223
|
})
|
|
211
224
|
.map((needle) => needle.id);
|
|
212
225
|
for (const dependencyId of dependencyIds) {
|
|
@@ -231,6 +244,44 @@ class Pipeline {
|
|
|
231
244
|
}
|
|
232
245
|
}
|
|
233
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* Gets a list of package names that are direct or indirect dependencies of rootPackageName in this.graph,
|
|
249
|
+
* and caches them on the Pipeline.
|
|
250
|
+
* @param packageName the root package to begin walking from
|
|
251
|
+
*/
|
|
252
|
+
getTransitiveGraphDependencies(packageName) {
|
|
253
|
+
var _a, _b;
|
|
254
|
+
const cachedResult = this.cachedTransitiveTaskDependencies.get(packageName);
|
|
255
|
+
if (cachedResult) {
|
|
256
|
+
return (cachedResult === "walk-in-progress")
|
|
257
|
+
// There is a recursive walk over this set of dependencies in progress.
|
|
258
|
+
// If we hit this case, that means that a dependency of this package depends on it.
|
|
259
|
+
//
|
|
260
|
+
// In this case we return an empty set to omit this package and it's downstream from its
|
|
261
|
+
// dependency
|
|
262
|
+
? new Set()
|
|
263
|
+
// we already computed this for this package, return the cached result.
|
|
264
|
+
: cachedResult;
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
// No cached result. Compute now with a recursive walk
|
|
268
|
+
// mark that we are traversing this package to prevent infinite recursion
|
|
269
|
+
// in cases of circular dependencies
|
|
270
|
+
this.cachedTransitiveTaskDependencies.set(packageName, 'walk-in-progress');
|
|
271
|
+
let immediateDependencies = (_b = (_a = this.graph[packageName]) === null || _a === void 0 ? void 0 : _a.dependencies) !== null && _b !== void 0 ? _b : [];
|
|
272
|
+
// build the set of transitive dependencies by recursively walking the
|
|
273
|
+
// immediate dependencies' dependencies.
|
|
274
|
+
let transitiveDepSet = new Set(immediateDependencies);
|
|
275
|
+
for (let immediateDependency of immediateDependencies) {
|
|
276
|
+
for (let transitiveSubDependency of this.getTransitiveGraphDependencies(immediateDependency)) {
|
|
277
|
+
transitiveDepSet.add(transitiveSubDependency);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
// Cache the result and return
|
|
281
|
+
this.cachedTransitiveTaskDependencies.set(packageName, transitiveDepSet);
|
|
282
|
+
return transitiveDepSet;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
234
285
|
generateTargetGraph() {
|
|
235
286
|
const scope = (0, getPipelinePackages_1.getPipelinePackages)(this.workspace, this.config);
|
|
236
287
|
const tasks = this.config.command;
|
|
@@ -55,7 +55,7 @@ class WrappedTarget {
|
|
|
55
55
|
let hash = null;
|
|
56
56
|
let cacheHit = false;
|
|
57
57
|
const { target, root, config, cacheOptions } = this;
|
|
58
|
-
if (config.cache) {
|
|
58
|
+
if (config.cache && target.cache) {
|
|
59
59
|
hash = await (0, backfill_1.cacheHash)(target.id, target.cwd, root, cacheOptions, config.args);
|
|
60
60
|
if (hash && !config.resetCache) {
|
|
61
61
|
cacheHit = await (0, backfill_1.cacheFetch)(hash, target.id, target.cwd, cacheOptions);
|
|
@@ -6,7 +6,8 @@ import { QueueOptions } from "bullmq";
|
|
|
6
6
|
export declare type NpmClient = "npm" | "yarn" | "pnpm";
|
|
7
7
|
export interface ConfigOptions {
|
|
8
8
|
/**
|
|
9
|
-
* Defines the task pipeline, prefix with "^" character to denote a topological dependency
|
|
9
|
+
* Defines the task pipeline, prefix with "^" character to denote a direct topological dependency,
|
|
10
|
+
* prefix with ^^ to denote a transitive topological dependency.
|
|
10
11
|
*
|
|
11
12
|
* Example:
|
|
12
13
|
*
|
|
@@ -15,6 +16,8 @@ export interface ConfigOptions {
|
|
|
15
16
|
* build: ["^build"],
|
|
16
17
|
* test: ["build"],
|
|
17
18
|
* lint: []
|
|
19
|
+
* bundle: ["^^transpile"],
|
|
20
|
+
* transpile: [],
|
|
18
21
|
* }
|
|
19
22
|
* ```
|
|
20
23
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lage",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "A monorepo task runner",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/microsoft/lage"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"abort-controller": "^3.0.0",
|
|
34
|
-
"backfill": "^6.1.
|
|
34
|
+
"backfill": "^6.1.11",
|
|
35
35
|
"backfill-cache": "^5.3.0",
|
|
36
36
|
"backfill-config": "^6.2.0",
|
|
37
37
|
"backfill-logger": "^5.1.3",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"p-graph": "^1.1.1",
|
|
47
47
|
"p-limit": "^3.1.0",
|
|
48
48
|
"p-profiler": "^0.2.1",
|
|
49
|
-
"workspace-tools": "^0.
|
|
49
|
+
"workspace-tools": "^0.18.2",
|
|
50
50
|
"yargs-parser": "^18.1.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|