@lage-run/cli 0.16.4 → 0.16.6

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 CHANGED
@@ -2,7 +2,79 @@
2
2
  "name": "@lage-run/cli",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 21 Dec 2023 08:37:30 GMT",
5
+ "date": "Mon, 26 Feb 2024 16:18:42 GMT",
6
+ "version": "0.16.6",
7
+ "tag": "@lage-run/cli_v0.16.6",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "sverre.johansen@gmail.com",
12
+ "package": "@lage-run/cli",
13
+ "commit": "9346c9d5b06973485c23cd3269228f91b0d79cbb",
14
+ "comment": "Fix undefined dependencies in info output"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Thu, 21 Dec 2023 09:49:09 GMT",
21
+ "version": "0.16.5",
22
+ "tag": "@lage-run/cli_v0.16.5",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "elcraig@microsoft.com",
27
+ "package": "@lage-run/cli",
28
+ "commit": "429047eb173880261b9e76f82ef1fcf7bfe9e29a",
29
+ "comment": "Pin external deps to ensure explicit updates to lage bundle"
30
+ },
31
+ {
32
+ "author": "beachball",
33
+ "package": "@lage-run/cli",
34
+ "comment": "Bump @lage-run/cache to v1.1.5",
35
+ "commit": "not available"
36
+ },
37
+ {
38
+ "author": "beachball",
39
+ "package": "@lage-run/cli",
40
+ "comment": "Bump @lage-run/config to v0.3.5",
41
+ "commit": "not available"
42
+ },
43
+ {
44
+ "author": "beachball",
45
+ "package": "@lage-run/cli",
46
+ "comment": "Bump @lage-run/hasher to v1.0.7",
47
+ "commit": "not available"
48
+ },
49
+ {
50
+ "author": "beachball",
51
+ "package": "@lage-run/cli",
52
+ "comment": "Bump @lage-run/reporters to v1.2.7",
53
+ "commit": "not available"
54
+ },
55
+ {
56
+ "author": "beachball",
57
+ "package": "@lage-run/cli",
58
+ "comment": "Bump @lage-run/scheduler to v1.1.12",
59
+ "commit": "not available"
60
+ },
61
+ {
62
+ "author": "beachball",
63
+ "package": "@lage-run/cli",
64
+ "comment": "Bump @lage-run/scheduler-types to v0.3.13",
65
+ "commit": "not available"
66
+ },
67
+ {
68
+ "author": "beachball",
69
+ "package": "@lage-run/cli",
70
+ "comment": "Bump @lage-run/target-graph to v0.8.9",
71
+ "commit": "not available"
72
+ }
73
+ ]
74
+ }
75
+ },
76
+ {
77
+ "date": "Thu, 21 Dec 2023 08:37:41 GMT",
6
78
  "version": "0.16.4",
7
79
  "tag": "@lage-run/cli_v0.16.4",
8
80
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,35 @@
1
1
  # Change Log - @lage-run/cli
2
2
 
3
- This log was last generated on Thu, 21 Dec 2023 08:37:30 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 26 Feb 2024 16:18:42 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.16.6
8
+
9
+ Mon, 26 Feb 2024 16:18:42 GMT
10
+
11
+ ### Patches
12
+
13
+ - Fix undefined dependencies in info output (sverre.johansen@gmail.com)
14
+
15
+ ## 0.16.5
16
+
17
+ Thu, 21 Dec 2023 09:49:09 GMT
18
+
19
+ ### Patches
20
+
21
+ - Pin external deps to ensure explicit updates to lage bundle (elcraig@microsoft.com)
22
+ - Bump @lage-run/cache to v1.1.5
23
+ - Bump @lage-run/config to v0.3.5
24
+ - Bump @lage-run/hasher to v1.0.7
25
+ - Bump @lage-run/reporters to v1.2.7
26
+ - Bump @lage-run/scheduler to v1.1.12
27
+ - Bump @lage-run/scheduler-types to v0.3.13
28
+ - Bump @lage-run/target-graph to v0.8.9
29
+
7
30
  ## 0.16.4
8
31
 
9
- Thu, 21 Dec 2023 08:37:30 GMT
32
+ Thu, 21 Dec 2023 08:37:41 GMT
10
33
 
11
34
  ### Patches
12
35
 
@@ -76,13 +76,12 @@ function prepareAndGetFilteredPackages(config, logger, root, options, packageInf
76
76
  }
77
77
  function processTargets(targets, packageInfos, config) {
78
78
  const packageTasks = new Map(); // Initialize the map with the correct type
79
+ const dependenciesCache = new Map();
79
80
  for (const target of targets.values()){
80
81
  if (shouldSkipTarget(target, packageInfos)) {
81
82
  continue;
82
83
  }
83
- const startIdIndex = target.dependencies.indexOf((0, _targetgraph.getStartTargetId)());
84
- target.dependencies.splice(startIdIndex, 1);
85
- const packageTask = generatePackageTask(target, config);
84
+ const packageTask = generatePackageTask(target, targets, packageInfos, dependenciesCache, config);
86
85
  if (packageTask) {
87
86
  // Check if the packageTask is defined before accessing its properties
88
87
  const packageName = packageTask.package;
@@ -94,22 +93,48 @@ function processTargets(targets, packageInfos, config) {
94
93
  }
95
94
  return packageTasks;
96
95
  }
96
+ function isTargetNoop(target, packageInfos) {
97
+ return !packageInfos[target.packageName]?.scripts?.[target.task];
98
+ }
97
99
  function shouldSkipTarget(target, packageInfos) {
98
- return target.id === (0, _targetgraph.getStartTargetId)() || !packageInfos[target.packageName ?? ""]?.scripts?.[target.task];
100
+ return target.id === (0, _targetgraph.getStartTargetId)() || isTargetNoop(target, packageInfos);
99
101
  }
100
- function generatePackageTask(target, config) {
102
+ function generatePackageTask(target, targets, packageInfos, dependenciesCache, config) {
101
103
  const command = generateCommand(target, config);
102
104
  const workingDirectory = getWorkingDirectory(target);
105
+ const dependenciesSet = resolveDependencies(target.dependencies, targets, packageInfos, dependenciesCache);
103
106
  const packageTask = {
104
107
  id: target.id,
105
108
  command,
106
- dependencies: target.dependencies,
109
+ dependencies: [
110
+ ...dependenciesSet
111
+ ],
107
112
  workingDirectory,
108
113
  package: target.packageName,
109
114
  task: target.task
110
115
  };
111
116
  return packageTask;
112
117
  }
118
+ function resolveDependencies(dependencies, targets, packageInfos, dependenciesCache) {
119
+ const result = new Set();
120
+ for (const dependency of dependencies){
121
+ if (dependency === (0, _targetgraph.getStartTargetId)()) {
122
+ continue;
123
+ }
124
+ if (!dependenciesCache.has(dependency)) {
125
+ const dependencyTarget = targets.get(dependency);
126
+ if (isTargetNoop(dependencyTarget, packageInfos)) {
127
+ dependenciesCache.set(dependency, resolveDependencies(dependencyTarget.dependencies, targets, packageInfos, dependenciesCache));
128
+ } else {
129
+ dependenciesCache.set(dependency, new Set([
130
+ dependency
131
+ ]));
132
+ }
133
+ }
134
+ dependenciesCache.get(dependency)?.forEach((dependency)=>result.add(dependency));
135
+ }
136
+ return result;
137
+ }
113
138
  function generateCommand(target, config) {
114
139
  const npmClient = config.npmClient ?? "npm";
115
140
  const command = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lage-run/cli",
3
- "version": "0.16.4",
3
+ "version": "0.16.6",
4
4
  "description": "Command Line Interface for Lage",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,20 +20,20 @@
20
20
  "lint": "monorepo-scripts lint"
21
21
  },
22
22
  "dependencies": {
23
- "@lage-run/cache": "^1.1.4",
24
- "@lage-run/config": "^0.3.4",
23
+ "@lage-run/cache": "^1.1.5",
24
+ "@lage-run/config": "^0.3.5",
25
25
  "@lage-run/find-npm-client": "^0.1.4",
26
- "@lage-run/hasher": "^1.0.6",
26
+ "@lage-run/hasher": "^1.0.7",
27
27
  "@lage-run/logger": "^1.3.0",
28
- "@lage-run/reporters": "^1.2.6",
29
- "@lage-run/scheduler": "^1.1.11",
30
- "@lage-run/scheduler-types": "^0.3.12",
31
- "@lage-run/target-graph": "^0.8.8",
28
+ "@lage-run/reporters": "^1.2.7",
29
+ "@lage-run/scheduler": "^1.1.12",
30
+ "@lage-run/scheduler-types": "^0.3.13",
31
+ "@lage-run/target-graph": "^0.8.9",
32
32
  "chokidar": "3.5.3",
33
- "commander": "^9.4.0",
34
- "execa": "^5.1.1",
35
- "fast-glob": "^3.2.12",
36
- "workspace-tools": "^0.36.4"
33
+ "commander": "9.5.0",
34
+ "execa": "5.1.1",
35
+ "fast-glob": "3.3.1",
36
+ "workspace-tools": "0.36.4"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@lage-run/monorepo-fixture": "*",