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.
- package/.release-plan.json +6 -14
- package/CHANGELOG.md +22 -0
- package/bin/cli.js +2 -1
- package/lib/program.js +5 -0
- package/lib/server.js +5 -3
- package/lib/utils.js +12 -0
- package/package.json +1 -1
package/.release-plan.json
CHANGED
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"solution": {
|
|
3
3
|
"build-start-rebuild-perf": {
|
|
4
|
-
"impact": "
|
|
5
|
-
"oldVersion": "0.
|
|
6
|
-
"newVersion": "0.0
|
|
4
|
+
"impact": "minor",
|
|
5
|
+
"oldVersion": "0.1.0",
|
|
6
|
+
"newVersion": "0.2.0",
|
|
7
7
|
"tagName": "latest",
|
|
8
8
|
"constraints": [
|
|
9
9
|
{
|
|
10
|
-
"impact": "
|
|
11
|
-
"reason": "Appears in changelog section :
|
|
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-
|
|
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
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(
|
|
37
|
-
},
|
|
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
|
+
}
|