build-start-rebuild-perf 0.3.0 → 0.4.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/.github/workflows/plan-release.yml +15 -48
- package/.github/workflows/publish.yml +4 -7
- package/.github/workflows/test.yml +1 -0
- package/.release-plan.json +11 -3
- package/CHANGELOG.md +28 -0
- package/README.md +1 -1
- package/biome.json +1 -1
- package/lib/browser.js +30 -6
- package/lib/measure.js +1 -1
- package/lib/utils.js +1 -0
- package/package.json +4 -5
- package/pnpm-workspace.yaml +5 -2
- package/renovate.json +7 -1
|
@@ -15,77 +15,44 @@ concurrency:
|
|
|
15
15
|
cancel-in-progress: true
|
|
16
16
|
|
|
17
17
|
jobs:
|
|
18
|
-
|
|
19
|
-
name:
|
|
18
|
+
should-run-release-plan-prepare:
|
|
19
|
+
name: Should we run release-plan prepare?
|
|
20
20
|
runs-on: ubuntu-latest
|
|
21
21
|
outputs:
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
should-prepare: ${{ steps.should-prepare.outputs.should-prepare }}
|
|
24
23
|
steps:
|
|
25
|
-
- uses: actions/
|
|
24
|
+
- uses: release-plan/actions/should-prepare-release@v1
|
|
26
25
|
with:
|
|
27
|
-
fetch-depth: 2
|
|
28
26
|
ref: 'main'
|
|
29
|
-
|
|
30
|
-
# when the .release-plan.json file was changed on the last commit.
|
|
31
|
-
- id: check-release
|
|
32
|
-
run: if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT
|
|
27
|
+
id: should-prepare
|
|
33
28
|
|
|
34
29
|
create-prepare-release-pr:
|
|
35
30
|
name: Create Prepare Release PR
|
|
36
31
|
runs-on: ubuntu-latest
|
|
37
32
|
timeout-minutes: 5
|
|
38
|
-
needs:
|
|
33
|
+
needs: should-run-release-plan-prepare
|
|
39
34
|
permissions:
|
|
40
35
|
contents: write
|
|
41
36
|
issues: read
|
|
42
37
|
pull-requests: write
|
|
43
|
-
|
|
44
|
-
# only run on labeled event if the PR has already been merged
|
|
45
|
-
if: ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && needs.is-this-a-release.outputs.command != 'release') || (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true)
|
|
46
|
-
|
|
38
|
+
if: needs.should-run-release-plan-prepare.outputs.should-prepare == 'true'
|
|
47
39
|
steps:
|
|
48
|
-
- uses: actions/
|
|
49
|
-
|
|
50
|
-
# github-changelog can discover what's changed since the last release
|
|
40
|
+
- uses: release-plan/actions/prepare@v1
|
|
41
|
+
name: Run release-plan prepare
|
|
51
42
|
with:
|
|
52
|
-
fetch-depth: 0
|
|
53
43
|
ref: 'main'
|
|
54
|
-
- uses: pnpm/action-setup@v4
|
|
55
|
-
- uses: actions/setup-node@v4
|
|
56
|
-
with:
|
|
57
|
-
node-version: 18
|
|
58
|
-
cache: pnpm
|
|
59
|
-
- run: pnpm install --frozen-lockfile
|
|
60
|
-
- name: "Generate Explanation and Prep Changelogs"
|
|
61
|
-
id: explanation
|
|
62
|
-
run: |
|
|
63
|
-
set +e
|
|
64
|
-
pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)
|
|
65
|
-
|
|
66
|
-
if [ $? -ne 0 ]; then
|
|
67
|
-
release_plan_output=$(cat release-plan-stderr.txt)
|
|
68
|
-
else
|
|
69
|
-
release_plan_output=$(jq .description .release-plan.json -r)
|
|
70
|
-
rm release-plan-stderr.txt
|
|
71
|
-
|
|
72
|
-
if [ $(jq '.solution | length' .release-plan.json) -eq 1 ]; then
|
|
73
|
-
new_version=$(jq -r '.solution[].newVersion' .release-plan.json)
|
|
74
|
-
echo "new_version=v$new_version" >> $GITHUB_OUTPUT
|
|
75
|
-
fi
|
|
76
|
-
fi
|
|
77
|
-
echo 'text<<EOF' >> $GITHUB_OUTPUT
|
|
78
|
-
echo "$release_plan_output" >> $GITHUB_OUTPUT
|
|
79
|
-
echo 'EOF' >> $GITHUB_OUTPUT
|
|
80
44
|
env:
|
|
81
45
|
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
|
|
46
|
+
id: explanation
|
|
82
47
|
|
|
83
|
-
- uses: peter-evans/create-pull-request@
|
|
48
|
+
- uses: peter-evans/create-pull-request@v8
|
|
49
|
+
name: Create Prepare Release PR
|
|
84
50
|
with:
|
|
85
|
-
commit-message: "Prepare Release ${{ steps.explanation.outputs.
|
|
51
|
+
commit-message: "Prepare Release ${{ steps.explanation.outputs.new-version}} using 'release-plan'"
|
|
86
52
|
labels: "internal"
|
|
53
|
+
sign-commits: true
|
|
87
54
|
branch: release-preview
|
|
88
|
-
title: Prepare Release ${{ steps.explanation.outputs.
|
|
55
|
+
title: Prepare Release ${{ steps.explanation.outputs.new-version }}
|
|
89
56
|
body: |
|
|
90
57
|
This PR is a preview of the release that [release-plan](https://github.com/embroider-build/release-plan) has prepared. To release you should just merge this PR 👍
|
|
91
58
|
|
|
@@ -22,17 +22,15 @@ jobs:
|
|
|
22
22
|
runs-on: ubuntu-latest
|
|
23
23
|
permissions:
|
|
24
24
|
contents: write
|
|
25
|
-
pull-requests: write
|
|
26
25
|
id-token: write
|
|
27
26
|
attestations: write
|
|
28
27
|
|
|
29
28
|
steps:
|
|
30
|
-
- uses: actions/checkout@
|
|
31
|
-
- uses: pnpm/action-setup@
|
|
32
|
-
- uses: actions/setup-node@
|
|
29
|
+
- uses: actions/checkout@v6
|
|
30
|
+
- uses: pnpm/action-setup@v5
|
|
31
|
+
- uses: actions/setup-node@v6
|
|
33
32
|
with:
|
|
34
|
-
node-version:
|
|
35
|
-
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
|
|
33
|
+
node-version: 24
|
|
36
34
|
registry-url: 'https://registry.npmjs.org'
|
|
37
35
|
cache: pnpm
|
|
38
36
|
- run: pnpm install --frozen-lockfile
|
|
@@ -40,4 +38,3 @@ jobs:
|
|
|
40
38
|
run: NPM_CONFIG_PROVENANCE=true pnpm release-plan publish
|
|
41
39
|
env:
|
|
42
40
|
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
|
|
43
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.release-plan.json
CHANGED
|
@@ -2,17 +2,25 @@
|
|
|
2
2
|
"solution": {
|
|
3
3
|
"build-start-rebuild-perf": {
|
|
4
4
|
"impact": "minor",
|
|
5
|
-
"oldVersion": "0.
|
|
6
|
-
"newVersion": "0.
|
|
5
|
+
"oldVersion": "0.3.0",
|
|
6
|
+
"newVersion": "0.4.0",
|
|
7
7
|
"tagName": "latest",
|
|
8
8
|
"constraints": [
|
|
9
9
|
{
|
|
10
10
|
"impact": "minor",
|
|
11
11
|
"reason": "Appears in changelog section :rocket: Enhancement"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"impact": "patch",
|
|
15
|
+
"reason": "Appears in changelog section :bug: Bug Fix"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"impact": "patch",
|
|
19
|
+
"reason": "Appears in changelog section :house: Internal"
|
|
12
20
|
}
|
|
13
21
|
],
|
|
14
22
|
"pkgJSONPath": "./package.json"
|
|
15
23
|
}
|
|
16
24
|
},
|
|
17
|
-
"description": "## Release (
|
|
25
|
+
"description": "## Release (2026-07-13)\n\n* build-start-rebuild-perf 0.4.0 (minor)\n\n#### :rocket: Enhancement\n* `build-start-rebuild-perf`\n * [#53](https://github.com/mainmatter/build-start-rebuild-perf/pull/53) Fix waitForPageToLoad behavior ([@NullVoxPopuli](https://github.com/NullVoxPopuli))\n * [#49](https://github.com/mainmatter/build-start-rebuild-perf/pull/49) Disable thousands separator for clearness ([@BlueCutOfficial](https://github.com/BlueCutOfficial))\n * [#43](https://github.com/mainmatter/build-start-rebuild-perf/pull/43) use standard puppeteer ([@mansona](https://github.com/mansona))\n\n#### :bug: Bug Fix\n* `build-start-rebuild-perf`\n * [#54](https://github.com/mainmatter/build-start-rebuild-perf/pull/54) Upgrade puppeteer so that tests pass ([@NullVoxPopuli](https://github.com/NullVoxPopuli))\n\n#### :house: Internal\n* `build-start-rebuild-perf`\n * [#66](https://github.com/mainmatter/build-start-rebuild-perf/pull/66) chore: update release-plan ([@BobrImperator](https://github.com/BobrImperator))\n * [#57](https://github.com/mainmatter/build-start-rebuild-perf/pull/57) stop running renovate on unpublished test app ([@mansona](https://github.com/mansona))\n * [#55](https://github.com/mainmatter/build-start-rebuild-perf/pull/55) make package.json licence match project licence ([@mansona](https://github.com/mansona))\n * [#56](https://github.com/mainmatter/build-start-rebuild-perf/pull/56) prevent version mismatch for puppeteer chrome install on CI ([@mansona](https://github.com/mansona))\n * [#44](https://github.com/mainmatter/build-start-rebuild-perf/pull/44) update biome schema to avoid warning ([@mansona](https://github.com/mansona))\n\n#### Committers: 4\n- Bartlomiej Dudzik ([@BobrImperator](https://github.com/BobrImperator))\n- Chris Manson ([@mansona](https://github.com/mansona))\n- Marine Dunstetter ([@BlueCutOfficial](https://github.com/BlueCutOfficial))\n- [@NullVoxPopuli](https://github.com/NullVoxPopuli)\n"
|
|
18
26
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Release (2026-07-13)
|
|
4
|
+
|
|
5
|
+
* build-start-rebuild-perf 0.4.0 (minor)
|
|
6
|
+
|
|
7
|
+
#### :rocket: Enhancement
|
|
8
|
+
* `build-start-rebuild-perf`
|
|
9
|
+
* [#53](https://github.com/mainmatter/build-start-rebuild-perf/pull/53) Fix waitForPageToLoad behavior ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
|
|
10
|
+
* [#49](https://github.com/mainmatter/build-start-rebuild-perf/pull/49) Disable thousands separator for clearness ([@BlueCutOfficial](https://github.com/BlueCutOfficial))
|
|
11
|
+
* [#43](https://github.com/mainmatter/build-start-rebuild-perf/pull/43) use standard puppeteer ([@mansona](https://github.com/mansona))
|
|
12
|
+
|
|
13
|
+
#### :bug: Bug Fix
|
|
14
|
+
* `build-start-rebuild-perf`
|
|
15
|
+
* [#54](https://github.com/mainmatter/build-start-rebuild-perf/pull/54) Upgrade puppeteer so that tests pass ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
|
|
16
|
+
|
|
17
|
+
#### :house: Internal
|
|
18
|
+
* `build-start-rebuild-perf`
|
|
19
|
+
* [#66](https://github.com/mainmatter/build-start-rebuild-perf/pull/66) chore: update release-plan ([@BobrImperator](https://github.com/BobrImperator))
|
|
20
|
+
* [#57](https://github.com/mainmatter/build-start-rebuild-perf/pull/57) stop running renovate on unpublished test app ([@mansona](https://github.com/mansona))
|
|
21
|
+
* [#55](https://github.com/mainmatter/build-start-rebuild-perf/pull/55) make package.json licence match project licence ([@mansona](https://github.com/mansona))
|
|
22
|
+
* [#56](https://github.com/mainmatter/build-start-rebuild-perf/pull/56) prevent version mismatch for puppeteer chrome install on CI ([@mansona](https://github.com/mansona))
|
|
23
|
+
* [#44](https://github.com/mainmatter/build-start-rebuild-perf/pull/44) update biome schema to avoid warning ([@mansona](https://github.com/mansona))
|
|
24
|
+
|
|
25
|
+
#### Committers: 4
|
|
26
|
+
- Bartlomiej Dudzik ([@BobrImperator](https://github.com/BobrImperator))
|
|
27
|
+
- Chris Manson ([@mansona](https://github.com/mansona))
|
|
28
|
+
- Marine Dunstetter ([@BlueCutOfficial](https://github.com/BlueCutOfficial))
|
|
29
|
+
- [@NullVoxPopuli](https://github.com/NullVoxPopuli)
|
|
30
|
+
|
|
3
31
|
## Release (2025-08-25)
|
|
4
32
|
|
|
5
33
|
* build-start-rebuild-perf 0.3.0 (minor)
|
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ pnpm dlx build-start-rebuild-perf --file "app/router.js" --wait-for ".logo"
|
|
|
41
41
|
|
|
42
42
|
| Dev Server Ready | First Paint | App Loaded | Reload after change |
|
|
43
43
|
| ---------------- | ----------- | ---------- | ------------------- |
|
|
44
|
-
|
|
|
44
|
+
| 5523 ms | 5618 ms | 6142 ms | 918 ms |
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
## Share with us
|
package/biome.json
CHANGED
package/lib/browser.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { promises as fs } from "node:fs";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
|
-
import
|
|
4
|
-
import puppeteer from "puppeteer-core";
|
|
3
|
+
import puppeteer from "puppeteer";
|
|
5
4
|
import { error, log, warn } from "./log.js";
|
|
6
5
|
|
|
7
6
|
export const VIEWPORT = {
|
|
@@ -14,7 +13,6 @@ let page = null;
|
|
|
14
13
|
|
|
15
14
|
export async function initBrowser() {
|
|
16
15
|
browser = await puppeteer.launch({
|
|
17
|
-
executablePath: Launcher.getInstallations()[0],
|
|
18
16
|
headless: process.env.SHOW_BROWSER !== "true",
|
|
19
17
|
args: ["--no-sandbox"],
|
|
20
18
|
});
|
|
@@ -49,6 +47,32 @@ export async function initBrowser() {
|
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
49
|
|
|
50
|
+
const HARD_CODED_NETWORK_IDLE_TIMEOUT = 30_000;
|
|
51
|
+
async function waitForNetworkIdle(page, pageLoadTimeout) {
|
|
52
|
+
let attempts = Math.max(pageLoadTimeout / HARD_CODED_NETWORK_IDLE_TIMEOUT, 1);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* waitForNetworkIdle has no configurable timeout
|
|
56
|
+
* and always times out at 30s, if your app takes
|
|
57
|
+
* more than 30s to finish dependency discovery and optimization.
|
|
58
|
+
* (easily possible on 3 million line code bases)
|
|
59
|
+
*/
|
|
60
|
+
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
61
|
+
log(`waitForNetworkIdle: attempt ${attempt} of ${attempts}`);
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
await page.waitForNetworkIdle();
|
|
65
|
+
return;
|
|
66
|
+
} catch (error) {
|
|
67
|
+
if (error.message.includes("Timed out after waiting 30000ms")) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
52
76
|
export async function measurePageLoad(url, waitForSelector = "body", pageLoadTimeout = 60_000) {
|
|
53
77
|
log(`Loading page: ${url}`);
|
|
54
78
|
|
|
@@ -64,7 +88,7 @@ export async function measurePageLoad(url, waitForSelector = "body", pageLoadTim
|
|
|
64
88
|
const atFirstPaint = performance.now();
|
|
65
89
|
|
|
66
90
|
log("Waiting for page to fully load...");
|
|
67
|
-
await
|
|
91
|
+
await waitForNetworkIdle(page, pageLoadTimeout);
|
|
68
92
|
|
|
69
93
|
log(`Waiting for element: ${waitForSelector}`);
|
|
70
94
|
await page.waitForSelector(waitForSelector, {
|
|
@@ -82,7 +106,7 @@ export async function measurePageLoad(url, waitForSelector = "body", pageLoadTim
|
|
|
82
106
|
};
|
|
83
107
|
}
|
|
84
108
|
|
|
85
|
-
export async function measureFileReload(filePath) {
|
|
109
|
+
export async function measureFileReload(filePath, pageLoadTimeout = 60_000) {
|
|
86
110
|
if (!filePath) {
|
|
87
111
|
log("No file specified for reload test, skipping...");
|
|
88
112
|
return 0;
|
|
@@ -108,7 +132,7 @@ export async function measureFileReload(filePath) {
|
|
|
108
132
|
const atFileChanged = performance.now();
|
|
109
133
|
|
|
110
134
|
log("Waiting for hot reload to complete...");
|
|
111
|
-
await
|
|
135
|
+
await waitForNetworkIdle(page, pageLoadTimeout);
|
|
112
136
|
|
|
113
137
|
const atReloadComplete = performance.now();
|
|
114
138
|
|
package/lib/measure.js
CHANGED
|
@@ -33,7 +33,7 @@ export async function measure(options) {
|
|
|
33
33
|
options.waitFor,
|
|
34
34
|
options.pageLoadTimeout,
|
|
35
35
|
);
|
|
36
|
-
const reloadMetrics = await measureFileReload(options.file);
|
|
36
|
+
const reloadMetrics = await measureFileReload(options.file, options.pageLoadTimeout);
|
|
37
37
|
await terminateServer();
|
|
38
38
|
|
|
39
39
|
return {
|
package/lib/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "build-start-rebuild-perf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git@github.com:mainmatter/build-start-rebuild-perf.git"
|
|
9
9
|
},
|
|
10
|
-
"license": "
|
|
10
|
+
"license": "MIT",
|
|
11
11
|
"author": "",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"bin": {
|
|
14
14
|
"build-start-rebuild-perf": "bin/cli.js"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"chrome-launcher": "^1.2.0",
|
|
18
17
|
"commander": "^14.0.0",
|
|
19
18
|
"execa": "^9.6.0",
|
|
20
19
|
"markdown-table": "^3.0.4",
|
|
21
|
-
"puppeteer
|
|
20
|
+
"puppeteer": "^24.36.1",
|
|
22
21
|
"strip-ansi": "^7.1.0"
|
|
23
22
|
},
|
|
24
23
|
"devDependencies": {
|
|
25
24
|
"@biomejs/biome": "^2.1.3",
|
|
26
|
-
"release-plan": "^0.
|
|
25
|
+
"release-plan": "^0.18.0",
|
|
27
26
|
"vitest": "^3.2.4"
|
|
28
27
|
},
|
|
29
28
|
"scripts": {
|
package/pnpm-workspace.yaml
CHANGED
package/renovate.json
CHANGED