@adobe/helix-rum-enhancer 1.21.1 → 1.23.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/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ # [1.23.0](https://github.com/adobe/helix-rum-enhancer/compare/v1.22.0...v1.23.0) (2024-08-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * source can be null ([#220](https://github.com/adobe/helix-rum-enhancer/issues/220)) ([4fe7ec4](https://github.com/adobe/helix-rum-enhancer/commit/4fe7ec4e0dae6f226bb2cc349dcf8aee59511d10))
7
+ * trigger semantic release ([2756bd2](https://github.com/adobe/helix-rum-enhancer/commit/2756bd28c68e51c072cbb89ec9e7114c538c387f))
8
+ * trigger semantic release ([ce6306e](https://github.com/adobe/helix-rum-enhancer/commit/ce6306e509fd60b376505a82966e1750e4652109))
9
+
10
+
11
+ ### Features
12
+
13
+ * **email:** rollout for all customers 1.x ([#221](https://github.com/adobe/helix-rum-enhancer/issues/221)) ([a8f7402](https://github.com/adobe/helix-rum-enhancer/commit/a8f74020ac01b17352021a64a8a8a3f3ef54673c))
14
+ * **paid:** roll out the paid checkpoint for all customers ([#214](https://github.com/adobe/helix-rum-enhancer/issues/214)) ([86cabf3](https://github.com/adobe/helix-rum-enhancer/commit/86cabf322c5c1b98b33327d0afe7bbe8025aab29))
15
+
16
+ # [1.22.0](https://github.com/adobe/helix-rum-enhancer/compare/v1.21.1...v1.22.0) (2024-06-10)
17
+
18
+
19
+ ### Features
20
+
21
+ * **paid:** enable `paid` checkpoint for two more domains ([fad1661](https://github.com/adobe/helix-rum-enhancer/commit/fad16619ace1fc75abe772442cc425fc11f32e73))
22
+
1
23
  ## [1.21.1](https://github.com/adobe/helix-rum-enhancer/compare/v1.21.0...v1.21.1) (2024-06-10)
2
24
 
3
25
 
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@adobe/helix-rum-enhancer",
3
- "version": "1.21.1",
3
+ "version": "1.23.0",
4
4
  "description": "Helix RUM Enhancer",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
- "test": "c8 mocha",
8
+ "setup-playwright": "npx playwright install --with-deps chromium firefox webkit",
9
+ "test": "npm run setup-playwright && web-test-runner --node-resolve --coverage --playwright --browsers chromium firefox webkit",
10
+ "test:ci": "npm run setup-playwright && web-test-runner --node-resolve --coverage --playwright --browsers chromium firefox webkit",
11
+ "test:watch": "web-test-runner --node-resolve --coverage --watch",
9
12
  "lint": "eslint .",
10
13
  "docs": "npx jsdoc2md -c .jsdoc.json --files 'src/*.js' > docs/API.md",
11
14
  "semantic-release": "semantic-release",
@@ -30,19 +33,24 @@
30
33
  },
31
34
  "devDependencies": {
32
35
  "@adobe/eslint-config-helix": "2.0.6",
36
+ "@esm-bundle/chai": "4.3.4-fix.0",
33
37
  "@semantic-release/changelog": "6.0.3",
34
38
  "@semantic-release/git": "10.0.1",
35
39
  "@semantic-release/npm": "12.0.1",
36
- "c8": "9.1.0",
40
+ "@web/test-runner": "0.18.2",
41
+ "@web/test-runner-core": "0.13.3",
42
+ "@web/test-runner-mocha": "0.9.0",
43
+ "@web/test-runner-playwright": "0.11.0",
44
+ "c8": "10.1.2",
37
45
  "codecov": "3.8.3",
38
46
  "eslint": "8.57.0",
39
47
  "eslint-plugin-header": "3.1.1",
40
48
  "eslint-plugin-import": "2.29.1",
41
- "husky": "9.0.11",
42
- "jsdoc-to-markdown": "8.0.1",
43
- "junit-report-builder": "3.2.1",
44
- "lint-staged": "15.2.5",
45
- "mocha": "10.4.0",
49
+ "husky": "9.1.3",
50
+ "jsdoc-to-markdown": "8.0.3",
51
+ "junit-report-builder": "4.0.0",
52
+ "lint-staged": "15.2.7",
53
+ "mocha": "10.7.0",
46
54
  "mocha-multi-reporters": "1.5.1",
47
55
  "semantic-release": "24.0.0"
48
56
  },
package/src/index.js CHANGED
@@ -18,8 +18,6 @@ const fflags = {
18
18
  enabled: (flag, callback) => fflags.has(flag) && callback(),
19
19
  disabled: (flag, callback) => !fflags.has(flag) && callback(),
20
20
  onetrust: [543, 770, 1136],
21
- ads: [1139, 543],
22
- email: [1139, 543],
23
21
  };
24
22
 
25
23
  sampleRUM.baseURL = sampleRUM.baseURL || new URL('https://rum.hlx.page');
@@ -111,8 +109,8 @@ sampleRUM.drain('cwv', (() => {
111
109
 
112
110
  if (measurement.name === 'LCP' && measurement.entries.length > 0) {
113
111
  const { element: el } = measurement.entries.pop();
114
- data.target = sampleRUM.targetselector(el);
115
- data.source = sampleRUM.sourceselector(el) || (el && el.outerHTML.slice(0, 30));
112
+ data.target = sampleRUM.targetselector(el) || '';
113
+ data.source = sampleRUM.sourceselector(el) || (el && el.outerHTML.slice(0, 30)) || '';
116
114
  }
117
115
 
118
116
  sampleRUM('cwv', data);
@@ -241,7 +239,8 @@ fflags.enabled('onetrust', () => {
241
239
  }
242
240
  });
243
241
 
244
- fflags.enabled('ads', () => {
242
+ // paid checkpoint
243
+ (() => {
245
244
  const networks = {
246
245
  google: /gclid|gclsrc|wbraid|gbraid/,
247
246
  doubleclick: /dclid/,
@@ -256,9 +255,10 @@ fflags.enabled('ads', () => {
256
255
  Object.entries(networks).forEach(([network, regex]) => {
257
256
  params.filter((param) => regex.test(param)).forEach((param) => sampleRUM('paid', { source: network, target: param }));
258
257
  });
259
- });
258
+ })();
260
259
 
261
- fflags.enabled('email', () => {
260
+ // email checkpoint
261
+ (() => {
262
262
  const networks = {
263
263
  mailchimp: /mc_(c|e)id/,
264
264
  marketo: /mkt_tok/,
@@ -268,4 +268,4 @@ fflags.enabled('email', () => {
268
268
  Object.entries(networks).forEach(([network, regex]) => {
269
269
  params.filter((param) => regex.test(param)).forEach((param) => sampleRUM('email', { source: network, target: param }));
270
270
  });
271
- });
271
+ })();
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright 2023 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export default {
13
+ coverageConfig: {
14
+ report: true,
15
+ reportDir: 'coverage',
16
+ exclude: [
17
+ 'test/fixtures/**',
18
+ 'node_modules/**',
19
+ ],
20
+ },
21
+ files: [
22
+ 'test/**/*.test.{html,js}',
23
+ 'test/*.test.{html,js}',
24
+ ],
25
+ };