@lage-run/cli 0.23.9 → 0.23.10

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,40 @@
2
2
  "name": "@lage-run/cli",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 22 Oct 2024 15:18:55 GMT",
5
+ "date": "Fri, 01 Nov 2024 08:07:21 GMT",
6
+ "version": "0.23.10",
7
+ "tag": "@lage-run/cli_v0.23.10",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "kchau@microsoft.com",
12
+ "package": "@lage-run/cli",
13
+ "commit": "0266df845498d81e8bfb2bd88abd5d4ad4177f6a",
14
+ "comment": "skip using npm client if running a node script"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@lage-run/cli",
19
+ "comment": "Bump @lage-run/config to v0.4.7",
20
+ "commit": "not available"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@lage-run/cli",
25
+ "comment": "Bump @lage-run/runners to v1.0.7",
26
+ "commit": "not available"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@lage-run/cli",
31
+ "comment": "Bump @lage-run/scheduler to v1.3.7",
32
+ "commit": "not available"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Tue, 22 Oct 2024 15:19:29 GMT",
6
39
  "version": "0.23.9",
7
40
  "tag": "@lage-run/cli_v0.23.9",
8
41
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,23 @@
1
1
  # Change Log - @lage-run/cli
2
2
 
3
- <!-- This log was last generated on Tue, 22 Oct 2024 15:18:55 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Fri, 01 Nov 2024 08:07:21 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.23.10
8
+
9
+ Fri, 01 Nov 2024 08:07:21 GMT
10
+
11
+ ### Patches
12
+
13
+ - skip using npm client if running a node script (kchau@microsoft.com)
14
+ - Bump @lage-run/config to v0.4.7
15
+ - Bump @lage-run/runners to v1.0.7
16
+ - Bump @lage-run/scheduler to v1.3.7
17
+
7
18
  ## 0.23.9
8
19
 
9
- Tue, 22 Oct 2024 15:18:55 GMT
20
+ Tue, 22 Oct 2024 15:19:29 GMT
10
21
 
11
22
  ### Patches
12
23
 
@@ -16,6 +16,7 @@ const _getFilteredPackages = require("../../filter/getFilteredPackages.js");
16
16
  const _logger = /*#__PURE__*/ _interop_require_default(require("@lage-run/logger"));
17
17
  const _targetgraph = require("@lage-run/target-graph");
18
18
  const _path = /*#__PURE__*/ _interop_require_default(require("path"));
19
+ const _shellquote = require("shell-quote");
19
20
  const _initializeReporters = require("../initializeReporters.js");
20
21
  const _runners = require("@lage-run/runners");
21
22
  const _getBinPaths = require("../../getBinPaths.js");
@@ -66,7 +67,7 @@ async function infoAction(options, command) {
66
67
  const runnerPicker = new _runners.TargetRunnerPicker(pickerOptions);
67
68
  const optimizedTargets = await optimizeTargetGraph(targetGraph, runnerPicker);
68
69
  const binPaths = (0, _getBinPaths.getBinPaths)();
69
- const packageTasks = optimizedTargets.map((target)=>generatePackageTask(target, taskArgs, config, options, binPaths));
70
+ const packageTasks = optimizedTargets.map((target)=>generatePackageTask(target, taskArgs, config, options, binPaths, packageInfos));
70
71
  logger.info("info", {
71
72
  command: command.args,
72
73
  scope,
@@ -88,8 +89,8 @@ async function optimizeTargetGraph(graph, runnerPicker) {
88
89
  });
89
90
  return (0, _targetgraph.transitiveReduction)(targetMinimizedNodes);
90
91
  }
91
- function generatePackageTask(target, taskArgs, config, options, binPaths) {
92
- const command = generateCommand(target, taskArgs, config, options, binPaths);
92
+ function generatePackageTask(target, taskArgs, config, options, binPaths, packageInfos) {
93
+ const command = generateCommand(target, taskArgs, config, options, binPaths, packageInfos);
93
94
  const workingDirectory = getWorkingDirectory(target);
94
95
  const packageTask = {
95
96
  id: target.id,
@@ -101,9 +102,21 @@ function generatePackageTask(target, taskArgs, config, options, binPaths) {
101
102
  };
102
103
  return packageTask;
103
104
  }
104
- function generateCommand(target, taskArgs, config, options, binPaths) {
105
+ function generateCommand(target, taskArgs, config, options, binPaths, packageInfos) {
105
106
  const shouldRunWorkersAsService = typeof process.env.LAGE_WORKER_SERVER === "string" && process.env.LAGE_WORKER_SERVER !== "false" || !!options.server;
106
107
  if (target.type === "npmScript") {
108
+ const script = target.packageName !== undefined ? packageInfos[target.packageName]?.scripts?.[target.task] : undefined;
109
+ // If the script is a node script, and that it does not have any shell operators (&&, ||, etc)
110
+ // then we can simply pass this along to info command rather than using npm client to run it.
111
+ if (script && script.startsWith("node")) {
112
+ const parsed = (0, _shellquote.parse)(script);
113
+ if (parsed.length > 0 && parsed.every((entry)=>typeof entry === "string")) {
114
+ return [
115
+ ...parsed,
116
+ ...taskArgs
117
+ ];
118
+ }
119
+ }
107
120
  const npmClient = config.npmClient ?? "npm";
108
121
  const command = [
109
122
  npmClient,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lage-run/cli",
3
- "version": "0.23.9",
3
+ "version": "0.23.10",
4
4
  "description": "Command Line Interface for Lage",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,14 +22,14 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@lage-run/cache": "^1.3.7",
25
- "@lage-run/config": "^0.4.6",
25
+ "@lage-run/config": "^0.4.7",
26
26
  "@lage-run/globby": "^14.2.0",
27
27
  "@lage-run/hasher": "^1.6.3",
28
28
  "@lage-run/logger": "^1.3.1",
29
29
  "@lage-run/reporters": "^1.2.15",
30
30
  "@lage-run/rpc": "^1.2.3",
31
- "@lage-run/runners": "^1.0.6",
32
- "@lage-run/scheduler": "^1.3.6",
31
+ "@lage-run/runners": "^1.0.7",
32
+ "@lage-run/scheduler": "^1.3.7",
33
33
  "@lage-run/scheduler-types": "^0.3.19",
34
34
  "@lage-run/target-graph": "^0.9.3",
35
35
  "@lage-run/worker-threads-pool": "^0.8.4",
@@ -38,12 +38,14 @@
38
38
  "execa": "5.1.1",
39
39
  "fast-glob": "3.3.2",
40
40
  "proper-lockfile": "^4.1.2",
41
+ "shell-quote": "^1.8.1",
41
42
  "workspace-tools": "0.37.0"
42
43
  },
43
44
  "devDependencies": {
44
45
  "@lage-run/monorepo-fixture": "*",
45
46
  "@lage-run/monorepo-scripts": "*",
46
- "@types/proper-lockfile": "^4.1.4"
47
+ "@types/proper-lockfile": "^4.1.4",
48
+ "@types/shell-quote": "^1.7.5"
47
49
  },
48
50
  "publishConfig": {
49
51
  "access": "public"