@rnx-kit/cli 0.18.7 → 0.18.8

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.
@@ -38,6 +38,10 @@ const commander_1 = require("commander");
38
38
  const path = __importStar(require("node:path"));
39
39
  const context_1 = require("./context");
40
40
  const externalCommands_1 = require("./externalCommands");
41
+ function parseDefaultValue(defaultValue, context) {
42
+ const value = typeof defaultValue === "function" ? defaultValue(context) : defaultValue;
43
+ return typeof value === "number" ? value.toString() : value;
44
+ }
41
45
  async function main() {
42
46
  const [, , userCommand] = process.argv;
43
47
  const context = await (0, context_1.loadContextForCommand)(userCommand);
@@ -51,12 +55,13 @@ async function main() {
51
55
  else {
52
56
  command.action((args, command) => func(command.args, context, args));
53
57
  }
54
- for (const { name, description, parse, default: def } of options) {
58
+ for (const { name, description, parse, default: defaultValue } of options) {
59
+ const value = parseDefaultValue(defaultValue, context);
55
60
  if (parse) {
56
- command.option(name, description ?? name, (input) => parse(input), def);
61
+ command.option(name, description ?? name, parse, value);
57
62
  }
58
63
  else {
59
- command.option(name, description, def?.toString());
64
+ command.option(name, description, value);
60
65
  }
61
66
  }
62
67
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.watch = watch;
4
4
  function watch(subproc, logger, onSuccess) {
5
5
  return new Promise((resolve) => {
6
+ const step = "Building";
6
7
  const errors = [];
7
8
  const isCI = Boolean(process.env.CI);
8
9
  if (isCI) {
@@ -10,7 +11,10 @@ function watch(subproc, logger, onSuccess) {
10
11
  subproc.stderr.on("data", (chunk) => process.stderr.write(chunk));
11
12
  }
12
13
  else {
13
- subproc.stdout.on("data", () => (logger.text += "."));
14
+ let i = 0;
15
+ subproc.stdout.on("data", () => {
16
+ logger.text = step + ".".repeat(++i % 6);
17
+ });
14
18
  subproc.stderr.on("data", (data) => errors.push(data));
15
19
  }
16
20
  subproc.on("close", (code) => {
@@ -25,7 +29,7 @@ function watch(subproc, logger, onSuccess) {
25
29
  }
26
30
  });
27
31
  logger.info(`Command: ${subproc.spawnargs.join(" ")}`);
28
- logger.start("Building");
32
+ logger.start(step);
29
33
  });
30
34
  }
31
35
  //# sourceMappingURL=watcher.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnx-kit/cli",
3
- "version": "0.18.7",
3
+ "version": "0.18.8",
4
4
  "description": "Command-line interface for working with kit packages in your repo",
5
5
  "homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/cli#readme",
6
6
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "test": "rnx-kit-scripts test"
40
40
  },
41
41
  "dependencies": {
42
- "@rnx-kit/align-deps": "^3.0.1",
42
+ "@rnx-kit/align-deps": "^3.0.5",
43
43
  "@rnx-kit/config": "^0.7.0",
44
44
  "@rnx-kit/console": "^2.0.0",
45
45
  "@rnx-kit/metro-plugin-cyclic-dependencies-detector": "^2.0.0",