build-start-rebuild-perf 0.0.1 → 0.2.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.
@@ -1,26 +1,18 @@
1
1
  {
2
2
  "solution": {
3
3
  "build-start-rebuild-perf": {
4
- "impact": "patch",
5
- "oldVersion": "0.0.0",
6
- "newVersion": "0.0.1",
4
+ "impact": "minor",
5
+ "oldVersion": "0.1.0",
6
+ "newVersion": "0.2.0",
7
7
  "tagName": "latest",
8
8
  "constraints": [
9
9
  {
10
- "impact": "patch",
11
- "reason": "Appears in changelog section :bug: Bug Fix"
12
- },
13
- {
14
- "impact": "patch",
15
- "reason": "Appears in changelog section :memo: Documentation"
16
- },
17
- {
18
- "impact": "patch",
19
- "reason": "Appears in changelog section :house: Internal"
10
+ "impact": "minor",
11
+ "reason": "Appears in changelog section :rocket: Enhancement"
20
12
  }
21
13
  ],
22
14
  "pkgJSONPath": "./package.json"
23
15
  }
24
16
  },
25
- "description": "## Release (2025-08-07)\n\n* build-start-rebuild-perf 0.0.1 (patch)\n\n#### :bug: Bug Fix\n* `build-start-rebuild-perf`\n * [#12](https://github.com/mainmatter/build-start-rebuild-perf/pull/12) fix pnpm workspace ([@mansona](https://github.com/mansona))\n\n#### :memo: Documentation\n* `build-start-rebuild-perf`\n * [#8](https://github.com/mainmatter/build-start-rebuild-perf/pull/8) Improve README ([@pichfl](https://github.com/pichfl))\n\n#### :house: Internal\n* `build-start-rebuild-perf`\n * [#7](https://github.com/mainmatter/build-start-rebuild-perf/pull/7) Run tests in CI ([@pichfl](https://github.com/pichfl))\n * [#6](https://github.com/mainmatter/build-start-rebuild-perf/pull/6) reset version in package.json ([@mansona](https://github.com/mansona))\n * [#4](https://github.com/mainmatter/build-start-rebuild-perf/pull/4) start using release-plan ([@mansona](https://github.com/mansona))\n\n#### Committers: 2\n- Chris Manson ([@mansona](https://github.com/mansona))\n- Florian Pichler ([@pichfl](https://github.com/pichfl))\n"
17
+ "description": "## Release (2025-08-09)\n\n* build-start-rebuild-perf 0.2.0 (minor)\n\n#### :rocket: Enhancement\n* `build-start-rebuild-perf`\n * [#23](https://github.com/mainmatter/build-start-rebuild-perf/pull/23) Configurable timeout ([@NullVoxPopuli](https://github.com/NullVoxPopuli))\n\n#### Committers: 1\n- [@NullVoxPopuli](https://github.com/NullVoxPopuli)\n"
26
18
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## Release (2025-08-09)
4
+
5
+ * build-start-rebuild-perf 0.2.0 (minor)
6
+
7
+ #### :rocket: Enhancement
8
+ * `build-start-rebuild-perf`
9
+ * [#23](https://github.com/mainmatter/build-start-rebuild-perf/pull/23) Configurable timeout ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
10
+
11
+ #### Committers: 1
12
+ - [@NullVoxPopuli](https://github.com/NullVoxPopuli)
13
+
14
+ ## Release (2025-08-08)
15
+
16
+ * build-start-rebuild-perf 0.1.0 (minor)
17
+
18
+ #### :rocket: Enhancement
19
+ * `build-start-rebuild-perf`
20
+ * [#21](https://github.com/mainmatter/build-start-rebuild-perf/pull/21) Show stack on error. ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
21
+
22
+ #### Committers: 1
23
+ - [@NullVoxPopuli](https://github.com/NullVoxPopuli)
24
+
3
25
  ## Release (2025-08-07)
4
26
 
5
27
  * build-start-rebuild-perf 0.0.1 (patch)
package/bin/cli.js CHANGED
@@ -35,6 +35,7 @@ ${formatResults(results)}
35
35
  );
36
36
  process.exit(0);
37
37
  } catch (err) {
38
- console.error("Measurement failed:", err.message);
38
+ console.error("Measurement failed");
39
+ console.error(err);
39
40
  process.exit(1);
40
41
  }
package/lib/program.js CHANGED
@@ -9,6 +9,11 @@ program
9
9
  .option("-f, --file <path>", "File to touch to trigger a reload")
10
10
  .option("-c, --command <cmd>", "Command to start dev server", "pnpm start")
11
11
  .option("-w, --wait-for <selector>", "Element selector to wait for", "body")
12
+ .option(
13
+ "-t, --timeout <timeout ms>",
14
+ "number of ms to wait for the server to become ready",
15
+ "120000",
16
+ )
12
17
  .addOption(
13
18
  new Option("-l, --log-level <level>", "Set the log level", "warn").choices([
14
19
  "log",
package/lib/server.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { execa } from "execa";
2
2
  import stripAnsi from "strip-ansi";
3
3
  import { log, warn } from "./log.js";
4
- import { PrefixedTransform } from "./utils.js";
4
+ import { PrefixedTransform, parseNumber } from "./utils.js";
5
5
 
6
6
  let server = null;
7
7
 
@@ -30,11 +30,13 @@ export async function startServer(options, extraArgs = "") {
30
30
 
31
31
  log("Waiting for server to start...");
32
32
 
33
+ let timeout = parseNumber(options.timeout);
34
+
33
35
  // Wait for server to be ready by watching output
34
36
  await new Promise((resolve, reject) => {
35
37
  const timeoutId = setTimeout(() => {
36
- reject(new Error("Server start timeout"));
37
- }, 120_000);
38
+ reject(new Error(`Server start timeout ( waited ${timeout}ms )`));
39
+ }, timeout);
38
40
 
39
41
  const urlToMatch = `//${new URL(options.url).host}`;
40
42
  const checkOutput = (line) => {
package/lib/utils.js CHANGED
@@ -43,3 +43,15 @@ const formatter = Intl.NumberFormat("en-US", {
43
43
  export function formatMs(timeMs) {
44
44
  return formatter.format(Math.round(timeMs));
45
45
  }
46
+
47
+ export function parseNumber(maybeNum) {
48
+ if (!maybeNum) return fallback;
49
+
50
+ let result = parseInt(maybeNum, 10);
51
+
52
+ if (Number.isNaN(result)) {
53
+ throw new Error(`Expected ${maybeNum} to be parsable to an integer. Instead received NaN.`);
54
+ }
55
+
56
+ return result;
57
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "build-start-rebuild-perf",
3
- "version": "0.0.1",
3
+ "version": "0.2.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "repository": {