@lage-run/cli 0.23.1 → 0.23.2

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,22 @@
2
2
  "name": "@lage-run/cli",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 04 Oct 2024 23:41:31 GMT",
5
+ "date": "Mon, 07 Oct 2024 19:33:03 GMT",
6
+ "version": "0.23.2",
7
+ "tag": "@lage-run/cli_v0.23.2",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "kchau@microsoft.com",
12
+ "package": "@lage-run/cli",
13
+ "commit": "43e4f422ae3436c5dedaa961469420ee683098b1",
14
+ "comment": "Fixing the action command generation to handle the case of launching as server without --server"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Fri, 04 Oct 2024 23:41:44 GMT",
6
21
  "version": "0.23.1",
7
22
  "tag": "@lage-run/cli_v0.23.1",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # Change Log - @lage-run/cli
2
2
 
3
- <!-- This log was last generated on Fri, 04 Oct 2024 23:41:31 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Mon, 07 Oct 2024 19:33:03 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.23.2
8
+
9
+ Mon, 07 Oct 2024 19:33:03 GMT
10
+
11
+ ### Patches
12
+
13
+ - Fixing the action command generation to handle the case of launching as server without --server (kchau@microsoft.com)
14
+
7
15
  ## 0.23.1
8
16
 
9
- Fri, 04 Oct 2024 23:41:31 GMT
17
+ Fri, 04 Oct 2024 23:41:44 GMT
10
18
 
11
19
  ### Patches
12
20
 
@@ -15,6 +15,7 @@ const _filterArgsForTasks = require("../run/filterArgsForTasks.js");
15
15
  const _simulateFileAccess = require("./simulateFileAccess.js");
16
16
  const _execa = /*#__PURE__*/ _interop_require_default(require("execa"));
17
17
  const _getBinPaths = require("../../getBinPaths.js");
18
+ const _parseServerOption = require("../parseServerOption.js");
18
19
  function _interop_require_default(obj) {
19
20
  return obj && obj.__esModule ? obj : {
20
21
  default: obj
@@ -74,12 +75,9 @@ async function executeOnServer(args, client, logger) {
74
75
  async function executeRemotely(options, command) {
75
76
  // launch a 'lage-server.js' process, detached if it is not already running
76
77
  // send the command to the server process
77
- const { server ="localhost:5332" } = options;
78
+ const { server } = options;
78
79
  const timeout = options.timeout ?? 120;
79
- const serverString = typeof options.server === "boolean" && options.server ? "localhost:5332" : !server ? "localhost:5332" : server;
80
- const parts = serverString.split(":");
81
- const host = parts[0];
82
- const port = parseInt(parts[1] ?? "5332");
80
+ const { host , port } = (0, _parseServerOption.parseServerOption)(server);
83
81
  const logger = (0, _logger.default)();
84
82
  options.logLevel = options.logLevel ?? "info";
85
83
  options.reporter = options.reporter ?? "json";
@@ -20,6 +20,7 @@ const _initializeReporters = require("../initializeReporters.js");
20
20
  const _runners = require("@lage-run/runners");
21
21
  const _getBinPaths = require("../../getBinPaths.js");
22
22
  const _runnerPickerOptions = require("../../runnerPickerOptions.js");
23
+ const _parseServerOption = require("../parseServerOption.js");
23
24
  function _interop_require_default(obj) {
24
25
  return obj && obj.__esModule ? obj : {
25
26
  default: obj
@@ -110,12 +111,13 @@ function generateCommand(target, taskArgs, config, options, binPaths) {
110
111
  ];
111
112
  return command;
112
113
  } else if (target.type === "worker" && shouldRunWorkersAsService) {
114
+ const { host , port } = (0, _parseServerOption.parseServerOption)(options.server);
113
115
  const command = [
114
116
  process.execPath,
115
117
  binPaths["lage"],
116
118
  "exec",
117
119
  "--server",
118
- options.server
120
+ `${host}:${port}`
119
121
  ];
120
122
  if (options.concurrency) {
121
123
  command.push("--concurrency", options.concurrency.toString());
@@ -0,0 +1,4 @@
1
+ export declare function parseServerOption(server: boolean | string | undefined): {
2
+ host: string;
3
+ port: number;
4
+ };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "parseServerOption", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return parseServerOption;
9
+ }
10
+ });
11
+ function parseServerOption(server) {
12
+ const isBooleanAndTrue = typeof server === "boolean" && server;
13
+ const isEmptyServer = typeof server === "undefined" || server === false;
14
+ const serverString = isBooleanAndTrue ? "localhost:5332" : isEmptyServer ? "localhost:5332" : server;
15
+ if (serverString.includes(":")) {
16
+ const parts = serverString.split(":");
17
+ const host = parts[0];
18
+ const port = parseInt(parts[1] ?? "5332");
19
+ return {
20
+ host,
21
+ port
22
+ };
23
+ } else if (serverString.length === 0) {
24
+ return {
25
+ host: "localhost",
26
+ port: 5332
27
+ };
28
+ } else {
29
+ return {
30
+ host: serverString,
31
+ port: 5332
32
+ };
33
+ }
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lage-run/cli",
3
- "version": "0.23.1",
3
+ "version": "0.23.2",
4
4
  "description": "Command Line Interface for Lage",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  "scripts": {
18
18
  "build": "tsc",
19
19
  "start": "tsc -w --preserveWatchOutput",
20
- "test": "jest",
20
+ "test": "monorepo-scripts jest",
21
21
  "lint": "monorepo-scripts lint"
22
22
  },
23
23
  "dependencies": {