@adobe/helix-rum-enhancer 2.52.0 → 2.53.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/.releaserc.cjs +5 -6
- package/docs/CI-CREDENTIALS.md +92 -0
- package/docs/RELEASE-MANIFEST.md +38 -0
- package/package.json +7 -8
- package/plugins/cwv.js +40 -41
- package/release-manifest.json +110 -0
- package/release-manifest.mjs +183 -0
- package/release-notes.md +18 -0
- package/rollup.config.js +13 -0
- package/src/plugins/cwv.js +340 -342
- package/src/plugins/cwv.map.js +341 -343
- package/src/plugins/cwv.md5 +1 -1
- package/src/plugins/form.md5 +1 -1
- package/src/plugins/redirect.md5 +1 -1
- package/src/plugins/usercentrics.md5 +1 -1
- package/src/plugins/video.md5 +1 -1
- package/src/plugins/webcomponent.md5 +1 -1
- package/src/vendor/web-vitals.iife.js +2 -0
- package/tagger.sh +139 -147
package/.releaserc.cjs
CHANGED
|
@@ -3,15 +3,13 @@ module.exports = {
|
|
|
3
3
|
"@semantic-release/commit-analyzer",
|
|
4
4
|
"@semantic-release/release-notes-generator",
|
|
5
5
|
["@semantic-release/changelog", {
|
|
6
|
-
"changelogFile": "
|
|
6
|
+
"changelogFile": "release-notes.md",
|
|
7
7
|
}],
|
|
8
8
|
"@semantic-release/npm",
|
|
9
|
-
["@semantic-release/git", {
|
|
10
|
-
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
|
|
11
|
-
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
12
|
-
}],
|
|
13
9
|
["@semantic-release/github", {
|
|
14
10
|
"assets": [
|
|
11
|
+
{ "path": "release-notes.md", "label": "Release notes" },
|
|
12
|
+
{ "path": "release-manifest.json", "label": "Release manifest (SHA-384 of every served file)" },
|
|
15
13
|
{
|
|
16
14
|
"path": "src/index.js",
|
|
17
15
|
"label": "RUM Enhancer JS"
|
|
@@ -27,7 +25,8 @@ module.exports = {
|
|
|
27
25
|
]
|
|
28
26
|
}],
|
|
29
27
|
["@semantic-release/exec", {
|
|
30
|
-
"
|
|
28
|
+
"verifyReleaseCmd": "./tagger.sh ${nextRelease.version} --check",
|
|
29
|
+
"publishCmd": "./tagger.sh ${nextRelease.version} --manifest release-manifest.json package.json package-lock.json release-notes.md --push"
|
|
31
30
|
}],
|
|
32
31
|
["semantic-release-slack-bot", {
|
|
33
32
|
notifyOnSuccess: true,
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# CI and release authorization
|
|
2
|
+
|
|
3
|
+
## Selected authorization model
|
|
4
|
+
|
|
5
|
+
- npm publication uses OIDC through a trusted publisher requiring the GitHub `release` environment. `main` needs no npm token; `1.x` is frozen (see below).
|
|
6
|
+
- GitHub API calls (releases, comments) use the job's short-lived `github.token` / `GITHUB_TOKEN`. All git pushes in the release job (`release-*` branches and semantic-release's `vX.Y.Z` tags) use a short-lived token from the private publisher App, minted inside the `release` environment. No `adobe-bot`, PAT or `RELEASE_GITHUB_TOKEN`.
|
|
7
|
+
- Build/test jobs default to read-only repository access. Only publishing jobs request the write permissions needed for tags, GitHub releases and release-branch updates. Metadata helpers retain their explicit, narrower permissions.
|
|
8
|
+
- Stored provider/notification credentials belong in the corresponding protected environment, never a shared publishing credential exposed to branch CI.
|
|
9
|
+
|
|
10
|
+
## Explicit publication pause
|
|
11
|
+
|
|
12
|
+
The repository variable `RELEASE_ENABLED` must compare equal to `true` for normal publication. It remains false during this migration. Unset/false skips publication while ordinary tests continue. Collector CI deployment and maintenance have independent `CI_DEPLOY_ENABLED` and `MAINTENANCE_ENABLED` switches.
|
|
13
|
+
|
|
14
|
+
These switches are operational controls, not authorization boundaries. Exact ref guards and environment branch policies remain required. Keep all switches false until the appropriate reviewed path has been validated.
|
|
15
|
+
|
|
16
|
+
## Source branches and generated metadata
|
|
17
|
+
|
|
18
|
+
Releases do not commit version/changelog changes back to `main` or `1.x`. The `@semantic-release/git` plugin is removed. npm's prepare step can update package metadata in the ephemeral release workspace, but no source-branch push is made.
|
|
19
|
+
|
|
20
|
+
Release-local notes are generated in `release-notes.md`, attached to the GitHub release, and included in the artifact branches where those are published. The generated file is cleared before each CI release. GitHub Releases/npm version metadata are authoritative; the source branch's historical `CHANGELOG.md` and package version are no longer automatically maintained by a publishing account.
|
|
21
|
+
|
|
22
|
+
No publisher gets a PR-review or force-push bypass on source branches. The old `adobe-bot` review allowances are removed. Repository review requirements remain enabled for administrators as well.
|
|
23
|
+
|
|
24
|
+
## Preserved AEM delivery path and release-branch writer
|
|
25
|
+
|
|
26
|
+
The tagger-backed 2.x publication path remains:
|
|
27
|
+
|
|
28
|
+
`release-* branches → AEM Code Sync → aem.live`
|
|
29
|
+
|
|
30
|
+
Only the private GitHub App **helix-rum-release-publisher** may create, update or force-update `release-*` branches. Deletion remains blocked, and the App has no bypass on `main` or `1.x`. It has repository contents read/write only, and is installed only on helix-rum-js and helix-rum-enhancer.
|
|
31
|
+
|
|
32
|
+
The release job and the canary mint a short-lived installation token with `actions/create-github-app-token` (pinned by commit SHA). They use the App client ID from the `release` environment variable `RELEASE_APP_CLIENT_ID` and the private key from the `release` environment secret `RELEASE_APP_PRIVATE_KEY`. The token is scoped to the current repository with `contents: write` and revoked when the job ends. Checkout persists it, so `tagger.sh` pushes release branches as the App. GitHub API calls (releases, issue and PR comments) still use the job's `GITHUB_TOKEN`.
|
|
33
|
+
|
|
34
|
+
Why not `GITHUB_TOKEN`: GitHub does not honor the GitHub Actions identity in branch push allowances or ruleset bypass lists. The first canary run failed with GH006 for this reason. Ordinary workflows with `contents: write` therefore cannot write `release-*`; only jobs that can read the `release` environment's key can, and that environment only admits `main`.
|
|
35
|
+
|
|
36
|
+
Checkout persists the App token for the whole release job, so semantic-release's `vX.Y.Z` tag push also goes out as the App. As of 18 November 2026, no tag protection or tag ruleset exists in helix-rum-js or helix-rum-enhancer (the only ruleset targets exact `release-*` branches). If a tag ruleset is added, it must allow `helix-rum-release-publisher`. The delivery canary exercises only the `release-*` path; the first real release exercises the tag push.
|
|
37
|
+
|
|
38
|
+
App-token pushes of both release branches and tags trigger ordinary `push` workflows, as the old bot pushes did; on `main`, the release job's `if:` and `.releaserc.cjs` `branches` name only `main`. A push runs the workflow files of the branch it lands on, and the frozen `1.x` branch's own copies still name `1.x`. What stops a 1.x release is the branch lock and the `release` environment admitting only `main`, not `main`'s configuration. AEM Code Sync is an external integration; check delivery with the canary workflow before relying on this path.
|
|
39
|
+
|
|
40
|
+
To rotate the key: generate a new private key in the App settings, pipe it into both repositories' `release` environment secret, then delete the old key in the App settings.
|
|
41
|
+
|
|
42
|
+
## Validation
|
|
43
|
+
|
|
44
|
+
`npm run test-release` loads the release configuration and resolves every plugin without publishing credentials. It also verifies there is no source-commit plugin or obsolete credentialed dry-run script. The tagger-backed packages additionally run local bare-Git tests for ref names, dirty/detached worktrees, missing/unsafe artifacts, atomic failure and stale leases.
|
|
45
|
+
|
|
46
|
+
Run the normal lint/browser/Node suites and `actionlint .github/workflows/*` as well. No validation command should reintroduce a publishing token into branch tests.
|
|
47
|
+
|
|
48
|
+
## Release environment
|
|
49
|
+
|
|
50
|
+
Allow only reviewed `main`. Keep the npm trusted publisher bound to environment `release` and keep bypass-2FA npm tokens disallowed. No npm secret is required. The only GitHub credential is the publisher App key described above. Existing Slack notification credentials, if used, are a separate environment-scoped integration.
|
|
51
|
+
|
|
52
|
+
### Tagger-backed publication
|
|
53
|
+
|
|
54
|
+
For the 2.x workflows, `tagger.sh` starts from the checked-out source commit and adds only explicitly listed generated files using an isolated Git index. It does not check out another branch, reset source history, borrow staged changes or modify the working tree.
|
|
55
|
+
|
|
56
|
+
- A stable version such as 2.3.4 updates `release-2-3-4`, `release-2-3-x` and `release-2-x` to one artifact commit.
|
|
57
|
+
- A prerelease updates only its normalized exact branch.
|
|
58
|
+
- With `--push`, remote refs are updated atomically using explicit per-ref leases. A rejected or concurrently changed ref fails the whole push; there is no partial/sequential fallback.
|
|
59
|
+
- Without `--push`, local refs are updated transactionally for inspection. Checked-out release refs are refused.
|
|
60
|
+
- Earlier exact versions are left alone by a newer release. This is not a write-once guarantee: deliberately republishing the same version can still rewrite its exact branch through the publisher App.
|
|
61
|
+
- Normal git/npm release tags remain semantic-release's responsibility. The tagger only publishes generated branches.
|
|
62
|
+
|
|
63
|
+
### Live authentication/Code Sync smoke test
|
|
64
|
+
|
|
65
|
+
After this workflow is merged to main, manually run **Verify release-branch delivery** (`verify-release-auth.yml`). It can run while normal publication is paused, from reviewed main in the release environment.
|
|
66
|
+
|
|
67
|
+
It writes a unique `release-0-0-0-auth-<run-id>` branch containing a harmless source/run marker, then verifies the bytes delivered by the corresponding `aem.live` URL with bounded retries. It does not publish npm packages, alter stable version aliases or enable any publication switch. It retains the canary branch; deleting it requires a deliberate maintainer action under the no-deletion policy.
|
|
68
|
+
|
|
69
|
+
This workflow exists on the tagger-backed 2.x mainline only.
|
|
70
|
+
|
|
71
|
+
## Frozen 1.x
|
|
72
|
+
|
|
73
|
+
`1.x` is frozen. Its branch protection has **Lock branch** enabled, which makes it read-only for everyone, administrators included. The `release` environment no longer admits `1.x`, so no run on `1.x` can use npm OIDC or the publisher App key. The last 1.x release stays as published (helix-rum-enhancer 1.23.1, npm dist-tag `release-1.x`). `1.x` also contains an unreleased runtime change (`b2769db`, OneTrust consent tracking for all sites, from #266); it will not ship. Renovate's `baseBranches` is `main` only.
|
|
74
|
+
|
|
75
|
+
To unfreeze, a maintainer must deliberately do all of these; skipping one leaves 1.x silently half-working:
|
|
76
|
+
|
|
77
|
+
1. Disable **Lock branch** on the `1.x` branch protection rule.
|
|
78
|
+
2. Add `1.x` back to the `release` environment's deployment branch policy.
|
|
79
|
+
3. Check that the `1.x` branch's own `.github/workflows/main.yaml` (release job `if:`) and `.releaserc.cjs` (`branches`) still admit `1.x`; they do today. Pushes to `1.x` use those copies, not `main`'s.
|
|
80
|
+
4. Add `1.x` to Renovate's `baseBranches` in `.renovaterc.json` (with `main`), so the branch gets dependency updates again.
|
|
81
|
+
|
|
82
|
+
## Backfilling release branches from npm
|
|
83
|
+
|
|
84
|
+
Older taggers published only some built files to the `release-*` branches, and no `release-1-x` alias existed. The collector served the gaps from jsDelivr/unpkg. **Backfill release branch from npm** (`backfill-release.yml`, manual, `main` only, `release` environment) repairs a branch from the published package:
|
|
85
|
+
|
|
86
|
+
- the tarball must match the registry's sha512 `integrity`;
|
|
87
|
+
- the branch must be `release-<version>`, or `release-<major>-x` for the newest `<major>.x` release;
|
|
88
|
+
- an existing branch only gets the built `.js` files it lacks (debug `*.map.js` builds are skipped); if any file it already serves differs from npm, nothing is pushed;
|
|
89
|
+
- a new branch starts from the `v<version>` tag and gets the package's built files and `package.json`;
|
|
90
|
+
- the push uses the publisher App token. Without the `push` input, it only prints the plan.
|
|
91
|
+
|
|
92
|
+
Exact `release-X-Y-Z` branches are write-once, so repairing one also needs a deliberate, temporary exclusion of that ref from the **Write-once exact release branches** ruleset, removed right after.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Release manifest and write-once releases
|
|
2
|
+
|
|
3
|
+
## Manifest
|
|
4
|
+
|
|
5
|
+
Every release publishes `release-manifest.json`:
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"schema": 1,
|
|
10
|
+
"package": "@adobe/helix-rum-enhancer",
|
|
11
|
+
"version": "X.Y.Z",
|
|
12
|
+
"source": { "commit": "<git sha of main>" },
|
|
13
|
+
"files": {
|
|
14
|
+
"src/<file>.js": { "integrity": "sha384-<base64>", "size": 1234 }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- `files` lists **every `.js` file the build writes under `src/`**, derived from the build output rather than a hand-maintained list. `integrity` uses the same format as Subresource Integrity, so it can be used directly in an `integrity` attribute.
|
|
20
|
+
- It's generated in `prepack`, right after the build that npm publishes, by `node release-manifest.mjs write`.
|
|
21
|
+
- It's attached to the GitHub release. **GitHub release immutability is enabled** for this repository, so that copy can't be changed after publication: it is the approved reference for monitors and the collector.
|
|
22
|
+
- It's also included in the `release-*` artifact branches (served via aem.live) and in the npm tarball.
|
|
23
|
+
|
|
24
|
+
`tagger.sh --manifest release-manifest.json` verifies, before changing any ref, that the manifest matches this version and the commit being published (`source.commit` must equal `HEAD`), that every built file is listed, and that every listed file's digest matches the bytes on disk. It then publishes exactly those files plus the manifest.
|
|
25
|
+
|
|
26
|
+
To check a served file by hand, compare the **decoded** bytes; aem.live always sends gzip:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
curl -s --compressed https://release-X-Y-Z--helix-rum-enhancer--adobe.aem.live/<path> | openssl dgst -sha384 -binary | base64
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Write-once exact releases
|
|
33
|
+
|
|
34
|
+
A repository ruleset, **Write-once exact release branches**, covers `refs/heads/release-[0-9]*-[0-9]*-[0-9]*`, which is every exact version and prerelease branch. It blocks updates, force pushes and deletion, with **no bypass actors**, administrators included. Creating a new exact branch is still allowed for the publisher App, through the classic `release-*` protection. Alias branches such as `release-2-x` and `release-2-17-x` aren't matched and keep moving to the newest release.
|
|
35
|
+
|
|
36
|
+
`tagger.sh` also refuses to publish when the exact branch already exists. semantic-release runs `tagger.sh <version> --check` in its **verifyRelease** step, before npm or GitHub publish anything, so an existing exact branch stops the whole release instead of failing after npm has already published.
|
|
37
|
+
|
|
38
|
+
Branch names replace every non-alphanumeric character with `-`, so `tagger.sh` only accepts versions for which that is reversible: no build metadata (`+...`) and no `-` inside prerelease identifiers (`2.4.0-rc.1` is fine, `2.4.0-rc-1` is rejected). Every version published so far meets this.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-rum-enhancer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.53.0",
|
|
4
4
|
"description": "Helix RUM Enhancer",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"lint": "eslint .",
|
|
13
13
|
"docs": "npx jsdoc2md -c .jsdoc.json --files 'src/*.js' > docs/API.md",
|
|
14
14
|
"build-bundle": "rollup --config",
|
|
15
|
-
"prepack": "npm run build-bundle",
|
|
15
|
+
"prepack": "npm run build-bundle && node release-manifest.mjs write",
|
|
16
|
+
"test-release": "node --test .github/tests/*.test.mjs",
|
|
16
17
|
"semantic-release": "semantic-release",
|
|
17
|
-
"semantic-release-dry": "semantic-release --dry-run --branches $CI_BRANCH",
|
|
18
18
|
"prepare": "husky"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"reporter-options": "configFile=.mocha-multi.json"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@adobe/eslint-config-helix": "3.0.
|
|
36
|
+
"@adobe/eslint-config-helix": "3.0.35",
|
|
37
37
|
"@adobe/helix-rum-js": "2.17.0",
|
|
38
38
|
"@adobe/rollup-plugin-checksum": "1.2.0",
|
|
39
39
|
"@eslint/config-helpers": "0.7.0",
|
|
@@ -41,11 +41,10 @@
|
|
|
41
41
|
"@rollup/plugin-babel": "7.1.0",
|
|
42
42
|
"@semantic-release/changelog": "7.0.0",
|
|
43
43
|
"@semantic-release/exec": "7.1.0",
|
|
44
|
-
"@semantic-release/git": "11.0.1",
|
|
45
44
|
"@semantic-release/npm": "13.2.0",
|
|
46
45
|
"@web/test-runner": "1.0.0",
|
|
47
46
|
"@web/test-runner-commands": "1.0.1",
|
|
48
|
-
"@web/test-runner-junit-reporter": "1.0.
|
|
47
|
+
"@web/test-runner-junit-reporter": "1.0.1",
|
|
49
48
|
"@web/test-runner-mocha": "1.0.0",
|
|
50
49
|
"@web/test-runner-playwright": "1.0.0",
|
|
51
50
|
"c8": "12.0.0",
|
|
@@ -53,14 +52,14 @@
|
|
|
53
52
|
"eslint": "9.39.5",
|
|
54
53
|
"eslint-plugin-header": "3.1.1",
|
|
55
54
|
"eslint-plugin-import": "2.32.0",
|
|
56
|
-
"globals": "17.
|
|
55
|
+
"globals": "17.14.0",
|
|
57
56
|
"husky": "9.1.7",
|
|
58
57
|
"jsdoc-to-markdown": "9.1.3",
|
|
59
58
|
"junit-report-builder": "5.1.2",
|
|
60
59
|
"lint-staged": "17.6.0",
|
|
61
60
|
"mocha": "12.0.3",
|
|
62
61
|
"mocha-multi-reporters": "1.5.2",
|
|
63
|
-
"rollup": "4.
|
|
62
|
+
"rollup": "4.68.2",
|
|
64
63
|
"rollup-plugin-eslint-bundle": "9.0.0",
|
|
65
64
|
"semantic-release": "25.0.9",
|
|
66
65
|
"semantic-release-slack-bot": "^4.0.2",
|
package/plugins/cwv.js
CHANGED
|
@@ -9,62 +9,61 @@
|
|
|
9
9
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
|
|
12
|
+
// web-vitals is bundled into this plugin from the lockfile-pinned package. There is no
|
|
13
|
+
// runtime script load, so nothing outside this release's manifest is executed.
|
|
14
|
+
/* eslint-disable import/no-extraneous-dependencies, import/no-relative-packages */
|
|
15
|
+
import {
|
|
16
|
+
onCLS, onINP, onLCP, onTTFB,
|
|
17
|
+
} from '../node_modules/web-vitals/dist/web-vitals.js';
|
|
18
|
+
/* eslint-enable import/no-extraneous-dependencies, import/no-relative-packages */
|
|
19
|
+
|
|
20
|
+
const METRICS = {
|
|
21
|
+
CLS: onCLS, INP: onINP, LCP: onLCP, TTFB: onTTFB,
|
|
22
|
+
};
|
|
15
23
|
|
|
16
24
|
export default function addCWVTracking({
|
|
17
25
|
sampleRUM, sourceSelector, targetSelector, fflags,
|
|
18
26
|
}) {
|
|
19
27
|
setTimeout(() => {
|
|
20
28
|
try {
|
|
29
|
+
// Older enhancers loaded web-vitals from this URL. If the page includes it itself,
|
|
30
|
+
// keep the previous behavior and don't register a second set of observers.
|
|
21
31
|
const cwvScript = new URL('.rum/web-vitals/dist/web-vitals.iife.js', sampleRUM.baseURL).href;
|
|
22
32
|
/* c8 ignore next 3 */
|
|
23
33
|
if (document.querySelector(`script[src="${cwvScript}"]`)) {
|
|
24
|
-
// web vitals script has been loaded already
|
|
25
34
|
return;
|
|
26
35
|
}
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
data.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
&& largest.sources.map((s) => s.node).find((n) => n && n.nodeType === 1);
|
|
45
|
-
if (node) {
|
|
46
|
-
data.source = sourceSelector(node) || node.outerHTML.slice(0, 30);
|
|
47
|
-
}
|
|
36
|
+
const storeCWV = (measurement) => {
|
|
37
|
+
const data = { cwv: {} };
|
|
38
|
+
data.cwv[measurement.name] = measurement.value;
|
|
39
|
+
if (measurement.name === 'LCP' && measurement.entries.length > 0) {
|
|
40
|
+
const { element } = measurement.entries.pop();
|
|
41
|
+
data.target = targetSelector(element);
|
|
42
|
+
data.source = sourceSelector(element) || (element && element.outerHTML.slice(0, 30));
|
|
43
|
+
}
|
|
44
|
+
if (measurement.name === 'CLS' && measurement.entries.length > 0) {
|
|
45
|
+
// Attribute CLS to the element of the single largest layout shift
|
|
46
|
+
// (mirrors web-vitals' `largestShiftTarget`, derived from the standard entries).
|
|
47
|
+
const largest = measurement.entries
|
|
48
|
+
.reduce((a, b) => (b.value > (a ? a.value : 0) ? b : a), undefined);
|
|
49
|
+
const node = largest && largest.sources
|
|
50
|
+
&& largest.sources.map((s) => s.node).find((n) => n && n.nodeType === 1);
|
|
51
|
+
if (node) {
|
|
52
|
+
data.source = sourceSelector(node) || node.outerHTML.slice(0, 30);
|
|
48
53
|
}
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
}
|
|
55
|
+
sampleRUM('cwv', data);
|
|
56
|
+
};
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
const isEager = (metric) => ['CLS', 'LCP'].includes(metric);
|
|
53
59
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (typeof metricFn === 'function') {
|
|
59
|
-
let opts = {};
|
|
60
|
-
fflags.enabled('eagercwv', () => {
|
|
61
|
-
opts = { reportAllChanges: isEager(metric) };
|
|
62
|
-
});
|
|
63
|
-
metricFn(storeCWV, opts);
|
|
64
|
-
}
|
|
60
|
+
['INP', 'TTFB', 'CLS', 'LCP'].forEach((metric) => {
|
|
61
|
+
let opts = {};
|
|
62
|
+
fflags.enabled('eagercwv', () => {
|
|
63
|
+
opts = { reportAllChanges: isEager(metric) };
|
|
65
64
|
});
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
METRICS[metric](storeCWV, opts);
|
|
66
|
+
});
|
|
68
67
|
/* c8 ignore next 3 */
|
|
69
68
|
} catch (error) {
|
|
70
69
|
// something went wrong
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": 1,
|
|
3
|
+
"package": "@adobe/helix-rum-enhancer",
|
|
4
|
+
"version": "2.53.0",
|
|
5
|
+
"source": {
|
|
6
|
+
"commit": "87b7ec070caaa095432be0384ab875b7f89945b6"
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"src/index.js": {
|
|
10
|
+
"integrity": "sha384-zoEXfXJ6U6Zbnao59dApLcpEYsT50jfDbMYYZ2dPJCdPcXl6doTyKRJW+RLJcplc",
|
|
11
|
+
"size": 15982
|
|
12
|
+
},
|
|
13
|
+
"src/index.map.js": {
|
|
14
|
+
"integrity": "sha384-xoUHRbXNs2A7fa776FyS8iQczYOu7QopdE9oR5Ch5HrEwx1O4EFw9Xg92E4R5zoz",
|
|
15
|
+
"size": 80735
|
|
16
|
+
},
|
|
17
|
+
"src/plugins/a11y.js": {
|
|
18
|
+
"integrity": "sha384-2RWhCFDrrIACD3dJFrB3zYkQeQkddRnn55SklGqDIe9qdWc+QFaXSI8KUOVKeQzL",
|
|
19
|
+
"size": 7385
|
|
20
|
+
},
|
|
21
|
+
"src/plugins/a11y.map.js": {
|
|
22
|
+
"integrity": "sha384-jzH75+jWwn/kUg/xz7B5+9ftjXfIH1XJbAZ5Y8G9TOmE/+9hAO/R9qQKb5r50xGU",
|
|
23
|
+
"size": 31606
|
|
24
|
+
},
|
|
25
|
+
"src/plugins/cwv.js": {
|
|
26
|
+
"integrity": "sha384-2RLWDWANtyU3cKnrO7OG/j1/v/S/2MVb+UV55PbbIFmEnn6t7s3r/9/x0Zzc983l",
|
|
27
|
+
"size": 15393
|
|
28
|
+
},
|
|
29
|
+
"src/plugins/cwv.map.js": {
|
|
30
|
+
"integrity": "sha384-8Beryvtjg8EqrcJZd5LwWjCLR3LCFa3dmnYLq4BvDh5aESXKOSJHKENGfNHJ1w36",
|
|
31
|
+
"size": 36702
|
|
32
|
+
},
|
|
33
|
+
"src/plugins/form.js": {
|
|
34
|
+
"integrity": "sha384-D2kpQFeuFT9w15uEqYf1aRulQotD9Z4bi+lx+UnW8drBmp3ax5iwaAjVzlPEbv5x",
|
|
35
|
+
"size": 3313
|
|
36
|
+
},
|
|
37
|
+
"src/plugins/form.map.js": {
|
|
38
|
+
"integrity": "sha384-/dRR2V+bfrT/fZdCYnjtXvWnbiEpE+qO/s66UFVjGy8XIHpgwg/nQCouylum7Kqt",
|
|
39
|
+
"size": 13730
|
|
40
|
+
},
|
|
41
|
+
"src/plugins/martech.js": {
|
|
42
|
+
"integrity": "sha384-bjSMPledoGxb/e4BNSwHzyeyb8Y/yGkOrhDcp287OQ8zzO6OYjmfD6unHFbuRpAB",
|
|
43
|
+
"size": 2183
|
|
44
|
+
},
|
|
45
|
+
"src/plugins/martech.map.js": {
|
|
46
|
+
"integrity": "sha384-R3c0RQVteXkwkI1giSIIsL9w2oGTOhixYWdYWkh2nVNcY1ORvf2fkMOv7MTGi1tQ",
|
|
47
|
+
"size": 8692
|
|
48
|
+
},
|
|
49
|
+
"src/plugins/onetrust.js": {
|
|
50
|
+
"integrity": "sha384-aTd37I2f3FvZ4VU+XK2b0cgdRjXlgVUVR1SdNY5gbrCJcM7beeoOJnYbyaXwS82W",
|
|
51
|
+
"size": 3065
|
|
52
|
+
},
|
|
53
|
+
"src/plugins/onetrust.map.js": {
|
|
54
|
+
"integrity": "sha384-SFs3IRkAIgc+4n2zrSk/c89EUXMlbe9kO2BMXGUGIA9y3F0wKYgI9o4f4YPKMXa2",
|
|
55
|
+
"size": 14582
|
|
56
|
+
},
|
|
57
|
+
"src/plugins/redirect.js": {
|
|
58
|
+
"integrity": "sha384-t7RPT7rYvH/T2yenaKr8e/f0NHD80Unb0SNwY9zV1auqa73N70WdxFv3jQeSD38H",
|
|
59
|
+
"size": 1680
|
|
60
|
+
},
|
|
61
|
+
"src/plugins/redirect.map.js": {
|
|
62
|
+
"integrity": "sha384-28yYguicbHnBJzYqr3sV42DK76knLMR7nQ97qCSBN45EITpNCRlCrWeNGMnHRqVm",
|
|
63
|
+
"size": 6649
|
|
64
|
+
},
|
|
65
|
+
"src/plugins/softnav.js": {
|
|
66
|
+
"integrity": "sha384-Lg5CdmI+5HyvMzi1yaJ+g/lECMjk7ERQyAIawsFPEZGGjmRkHpzx7yMcTG/XL0XA",
|
|
67
|
+
"size": 4098
|
|
68
|
+
},
|
|
69
|
+
"src/plugins/softnav.map.js": {
|
|
70
|
+
"integrity": "sha384-MTglqjtjtacvfVIwqRm1emkj2S7nOt06ESvyezF51If7xl2a9gFj76Yl3S/hrQWr",
|
|
71
|
+
"size": 23331
|
|
72
|
+
},
|
|
73
|
+
"src/plugins/trustarc.js": {
|
|
74
|
+
"integrity": "sha384-taZbjtJGEslKmH7k+EBOcs6CEd3ndt2MMDZSjJwEvwbVGtiMRVmafWM/vBYl23ZW",
|
|
75
|
+
"size": 2775
|
|
76
|
+
},
|
|
77
|
+
"src/plugins/trustarc.map.js": {
|
|
78
|
+
"integrity": "sha384-j/F0QWIcb9XH8VYJkbaG8oKl43b6p+FT13Qwc4thz0fCMxCBJVnpIFAj5eQLuXpK",
|
|
79
|
+
"size": 13168
|
|
80
|
+
},
|
|
81
|
+
"src/plugins/usercentrics.js": {
|
|
82
|
+
"integrity": "sha384-A08HPM+M4zeEoFtN0hFoW0KeY+P8NODz/GgBmTqRDq3admynYarw2x2xny82w5tM",
|
|
83
|
+
"size": 3119
|
|
84
|
+
},
|
|
85
|
+
"src/plugins/usercentrics.map.js": {
|
|
86
|
+
"integrity": "sha384-Sbo4wkupk+4/aQsnmASV3pk6WVDk5dgcBU+3UUhzPz6SNOvEoZ2XTYCfqlElFQe2",
|
|
87
|
+
"size": 13944
|
|
88
|
+
},
|
|
89
|
+
"src/plugins/video.js": {
|
|
90
|
+
"integrity": "sha384-X22EqiA6/F0gvyKQeAspj/c11tI8FUO1HgzycoK7gLhi/WXbwR5SVFe/en4zGKUn",
|
|
91
|
+
"size": 761
|
|
92
|
+
},
|
|
93
|
+
"src/plugins/video.map.js": {
|
|
94
|
+
"integrity": "sha384-BmiwAJ8Pr+JiNXgshH1+pcqBlGc95BfqOhgMU07DcxWvQlyKeCFxz159tWJZCvRl",
|
|
95
|
+
"size": 2310
|
|
96
|
+
},
|
|
97
|
+
"src/plugins/webcomponent.js": {
|
|
98
|
+
"integrity": "sha384-pKsfDE3NwfW+vmc+77M78UJyclkkLmBZZX4ARjZJJeyNAokJKW1hKgB0v8D9mgfs",
|
|
99
|
+
"size": 2734
|
|
100
|
+
},
|
|
101
|
+
"src/plugins/webcomponent.map.js": {
|
|
102
|
+
"integrity": "sha384-mY561D6ivOrQJX4/r45Dq7eCmhqhWSbrjcj4b7ksLuf/WlvflDMr7XuMExyklZBa",
|
|
103
|
+
"size": 12079
|
|
104
|
+
},
|
|
105
|
+
"src/vendor/web-vitals.iife.js": {
|
|
106
|
+
"integrity": "sha384-sKh//42d8+X4ztiyB4ChMShr0tmbWDWrkHfy9pLz9napB81dM74xVylUQVmZ94PE",
|
|
107
|
+
"size": 8991
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2026 Adobe. All rights reserved.
|
|
4
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
6
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
*
|
|
8
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
9
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
10
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
11
|
+
* governing permissions and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// Release manifest: every executable file a release serves, with its SHA-384 digest.
|
|
15
|
+
//
|
|
16
|
+
// node release-manifest.mjs write [manifest] after the build (prepack)
|
|
17
|
+
// node release-manifest.mjs verify <manifest> <version> before publishing branches
|
|
18
|
+
// node release-manifest.mjs files <manifest> one path per line, for tagger.sh
|
|
19
|
+
//
|
|
20
|
+
// The file list comes from the build output, not from a hand-maintained list, so a new
|
|
21
|
+
// plugin cannot be silently left out of a release.
|
|
22
|
+
import { createHash } from 'node:crypto';
|
|
23
|
+
import { execFileSync } from 'node:child_process';
|
|
24
|
+
import {
|
|
25
|
+
lstatSync, readdirSync, readFileSync, writeFileSync,
|
|
26
|
+
} from 'node:fs';
|
|
27
|
+
import { join, resolve, sep } from 'node:path';
|
|
28
|
+
import process from 'node:process';
|
|
29
|
+
import { pathToFileURL } from 'node:url';
|
|
30
|
+
|
|
31
|
+
export const SCHEMA = 1;
|
|
32
|
+
export const DEFAULT_MANIFEST = 'release-manifest.json';
|
|
33
|
+
|
|
34
|
+
// Build output directories per package. Only .js files are executable release assets.
|
|
35
|
+
export const BUILD_ROOTS = {
|
|
36
|
+
'@adobe/helix-rum-js': ['dist'],
|
|
37
|
+
'@adobe/helix-rum-enhancer': ['src'],
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function fail(message) {
|
|
41
|
+
throw new Error(`release-manifest: ${message}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function readPackage(cwd) {
|
|
45
|
+
return JSON.parse(readFileSync(join(cwd, 'package.json'), 'utf8'));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function walk(cwd, dir) {
|
|
49
|
+
const out = [];
|
|
50
|
+
readdirSync(join(cwd, dir), { withFileTypes: true }).forEach((entry) => {
|
|
51
|
+
const path = join(dir, entry.name);
|
|
52
|
+
if (entry.isSymbolicLink()) {
|
|
53
|
+
fail(`symlink in build output: ${path}`);
|
|
54
|
+
} else if (entry.isDirectory()) {
|
|
55
|
+
out.push(...walk(cwd, path));
|
|
56
|
+
} else if (entry.isFile() && entry.name.endsWith('.js')) {
|
|
57
|
+
out.push(path.split(sep).join('/'));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function builtFiles(cwd, name) {
|
|
64
|
+
const roots = BUILD_ROOTS[name];
|
|
65
|
+
if (!roots) {
|
|
66
|
+
fail(`no build roots configured for ${name}`);
|
|
67
|
+
}
|
|
68
|
+
const files = roots.flatMap((root) => walk(cwd, root)).sort();
|
|
69
|
+
if (files.length === 0) {
|
|
70
|
+
fail(`no built .js files under ${roots.join(', ')}; run the build first`);
|
|
71
|
+
}
|
|
72
|
+
return files;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function digest(cwd, path) {
|
|
76
|
+
const stat = lstatSync(join(cwd, path));
|
|
77
|
+
if (!stat.isFile()) {
|
|
78
|
+
fail(`not a regular file: ${path}`);
|
|
79
|
+
}
|
|
80
|
+
const bytes = readFileSync(join(cwd, path));
|
|
81
|
+
return {
|
|
82
|
+
integrity: `sha384-${createHash('sha384').update(bytes).digest('base64')}`,
|
|
83
|
+
size: bytes.length,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function sourceCommit(cwd) {
|
|
88
|
+
try {
|
|
89
|
+
return execFileSync('git', ['rev-parse', 'HEAD'], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim();
|
|
90
|
+
} catch (e) {
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function createManifest(cwd) {
|
|
96
|
+
const pkg = readPackage(cwd);
|
|
97
|
+
const files = {};
|
|
98
|
+
builtFiles(cwd, pkg.name).forEach((path) => {
|
|
99
|
+
files[path] = digest(cwd, path);
|
|
100
|
+
});
|
|
101
|
+
const commit = sourceCommit(cwd);
|
|
102
|
+
return {
|
|
103
|
+
schema: SCHEMA,
|
|
104
|
+
package: pkg.name,
|
|
105
|
+
version: pkg.version,
|
|
106
|
+
...(commit ? { source: { commit } } : {}),
|
|
107
|
+
files,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function readManifest(cwd, manifestPath) {
|
|
112
|
+
const manifest = JSON.parse(readFileSync(resolve(cwd, manifestPath), 'utf8'));
|
|
113
|
+
if (manifest.schema !== SCHEMA || typeof manifest.files !== 'object' || !manifest.files) {
|
|
114
|
+
fail(`${manifestPath} is not a schema ${SCHEMA} release manifest`);
|
|
115
|
+
}
|
|
116
|
+
Object.keys(manifest.files).forEach((path) => {
|
|
117
|
+
if (path.startsWith('/') || path.split('/').includes('..')) {
|
|
118
|
+
fail(`unsafe path in manifest: ${path}`);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
return manifest;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function verifyManifest(cwd, manifestPath, version) {
|
|
125
|
+
const manifest = readManifest(cwd, manifestPath);
|
|
126
|
+
const pkg = readPackage(cwd);
|
|
127
|
+
const problems = [];
|
|
128
|
+
if (manifest.package !== pkg.name) {
|
|
129
|
+
problems.push(`package ${manifest.package} does not match ${pkg.name}`);
|
|
130
|
+
}
|
|
131
|
+
if (manifest.version !== version) {
|
|
132
|
+
problems.push(`version ${manifest.version} does not match ${version}`);
|
|
133
|
+
}
|
|
134
|
+
// Provenance: the manifest must name the commit being published (tagger.sh builds the
|
|
135
|
+
// artifact commit on HEAD), so a copied or edited manifest cannot misattribute a release.
|
|
136
|
+
const head = sourceCommit(cwd);
|
|
137
|
+
const recorded = manifest.source && manifest.source.commit;
|
|
138
|
+
if (!head) {
|
|
139
|
+
problems.push('cannot determine the source commit: git rev-parse HEAD failed');
|
|
140
|
+
} else if (recorded !== head) {
|
|
141
|
+
problems.push(`source commit ${recorded || '(missing)'} does not match HEAD ${head}`);
|
|
142
|
+
}
|
|
143
|
+
const listed = Object.keys(manifest.files).sort();
|
|
144
|
+
const built = builtFiles(cwd, pkg.name);
|
|
145
|
+
built.filter((path) => !listed.includes(path)).forEach((path) => problems.push(`built but not in manifest: ${path}`));
|
|
146
|
+
listed.filter((path) => !built.includes(path)).forEach((path) => problems.push(`in manifest but not built: ${path}`));
|
|
147
|
+
listed.filter((path) => built.includes(path)).forEach((path) => {
|
|
148
|
+
const actual = digest(cwd, path);
|
|
149
|
+
const expected = manifest.files[path];
|
|
150
|
+
if (actual.integrity !== expected.integrity || actual.size !== expected.size) {
|
|
151
|
+
problems.push(`digest mismatch: ${path}`);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
if (problems.length) {
|
|
155
|
+
fail(`${manifestPath} failed verification:\n ${problems.join('\n ')}`);
|
|
156
|
+
}
|
|
157
|
+
return manifest;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function main([command, ...args]) {
|
|
161
|
+
const cwd = process.cwd();
|
|
162
|
+
if (command === 'write') {
|
|
163
|
+
const path = args[0] || DEFAULT_MANIFEST;
|
|
164
|
+
const manifest = createManifest(cwd);
|
|
165
|
+
writeFileSync(resolve(cwd, path), `${JSON.stringify(manifest, null, 2)}\n`);
|
|
166
|
+
process.stdout.write(`Wrote ${path}: ${manifest.package}@${manifest.version}, ${Object.keys(manifest.files).length} files\n`);
|
|
167
|
+
} else if (command === 'verify' && args.length === 2) {
|
|
168
|
+
verifyManifest(cwd, args[0], args[1]);
|
|
169
|
+
} else if (command === 'files' && args.length === 1) {
|
|
170
|
+
process.stdout.write(Object.keys(readManifest(cwd, args[0]).files).map((p) => `${p}\n`).join(''));
|
|
171
|
+
} else {
|
|
172
|
+
fail('usage: write [manifest] | verify <manifest> <version> | files <manifest>');
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
177
|
+
try {
|
|
178
|
+
main(process.argv.slice(2));
|
|
179
|
+
} catch (e) {
|
|
180
|
+
process.stderr.write(`${e.message}\n`);
|
|
181
|
+
process.exit(1);
|
|
182
|
+
}
|
|
183
|
+
}
|
package/release-notes.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# [2.53.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.52.0...v2.53.0) (2026-11-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **ci:** fail the backfill workflow when the script refuses ([2003f4b](https://github.com/adobe/helix-rum-enhancer/commit/2003f4b547399ac7fdcc8be65360d34e79ff08ab))
|
|
7
|
+
* **ci:** isolate branch CI and make publishing pause explicit ([#637](https://github.com/adobe/helix-rum-enhancer/issues/637)) ([f847e24](https://github.com/adobe/helix-rum-enhancer/commit/f847e249d6488aa081803a2ae1266335c0b226d6))
|
|
8
|
+
* **ci:** publish releases without a bot account ([#640](https://github.com/adobe/helix-rum-enhancer/issues/640)) ([748b7a2](https://github.com/adobe/helix-rum-enhancer/commit/748b7a29e809faf452ae2b128dfa32d322859274))
|
|
9
|
+
* **ci:** push release branches with the publisher App ([#642](https://github.com/adobe/helix-rum-enhancer/issues/642)) ([07c73eb](https://github.com/adobe/helix-rum-enhancer/commit/07c73eb9722a9571b03478e3d5864c71900a6ca1))
|
|
10
|
+
* **cwv:** use the bundled web-vitals instead of loading it at runtime ([4b7063d](https://github.com/adobe/helix-rum-enhancer/commit/4b7063de763cf0c60f1ac222801813dc4e692131))
|
|
11
|
+
* **release:** check exact-branch availability before publishing; reject ambiguous versions ([2c2898a](https://github.com/adobe/helix-rum-enhancer/commit/2c2898a79adb7e675bb8ce674e5055a39459081b))
|
|
12
|
+
* **release:** require the manifest source commit to match HEAD ([278ab2f](https://github.com/adobe/helix-rum-enhancer/commit/278ab2f6e129f33981b0c912e2f26895b2f52937))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **release:** publish a manifest of every built file and make exact releases write-once ([dba8cf0](https://github.com/adobe/helix-rum-enhancer/commit/dba8cf0711d4494bbfc320bddfbb4ba1d6b0aed8))
|
|
18
|
+
* **release:** publish a manifest of every built file and make exact releases write-once ([#645](https://github.com/adobe/helix-rum-enhancer/issues/645)) ([d046188](https://github.com/adobe/helix-rum-enhancer/commit/d04618838aa741f8d4eca9374656f4bc027100e6))
|