@adobe/helix-rum-enhancer 2.33.0 → 2.34.1

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 CHANGED
@@ -6,6 +6,9 @@ module.exports = {
6
6
  "changelogFile": "CHANGELOG.md",
7
7
  }],
8
8
  "@semantic-release/npm",
9
+ ["@semantic-release/exec", {
10
+ "publishCmd": "./tagger.sh ${nextRelease.version} src/index.js src/plugins/cwv.js src/plugins/form.js src/plugins/martech.js src/plugins/onetrust.js src/plugins/video.js --push"
11
+ }],
9
12
  ["@semantic-release/git", {
10
13
  "assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
11
14
  "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
@@ -26,7 +29,7 @@ module.exports = {
26
29
  notifyOnSuccess: true,
27
30
  notifyOnFail: true,
28
31
  markdownReleaseNotes: true,
29
- slackChannel: "rum-explorers",
32
+ slackChannel: "optel-explorers",
30
33
  }],
31
34
  ],
32
35
  branches: ['main'],
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [2.34.1](https://github.com/adobe/helix-rum-enhancer/compare/v2.34.0...v2.34.1) (2025-04-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * trigger release ([fd3b7c1](https://github.com/adobe/helix-rum-enhancer/commit/fd3b7c135f376d60e5f7444f05692354258ac73e))
7
+
8
+ # [2.34.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.33.0...v2.34.0) (2025-04-16)
9
+
10
+
11
+ ### Features
12
+
13
+ * add class in source selector ([#398](https://github.com/adobe/helix-rum-enhancer/issues/398)) ([c72aa0d](https://github.com/adobe/helix-rum-enhancer/commit/c72aa0d66074a66b2ebeed4a625989c040112eee))
14
+
1
15
  # [2.33.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.32.0...v2.33.0) (2025-03-24)
2
16
 
3
17
 
package/modules/dom.js CHANGED
@@ -61,7 +61,10 @@ function getSourceContext(el) {
61
61
  const formEl = el.closest('form');
62
62
  if (formEl) {
63
63
  const id = formEl.getAttribute('id');
64
- return `form${id ? `#${id}` : ''}`;
64
+ if (id) {
65
+ return `form#${id}`;
66
+ }
67
+ return `form${formEl.classList.length > 0 ? `.${formEl.classList[0]}` : ''}`;
65
68
  }
66
69
  const block = el.closest('.block[data-block-name]');
67
70
  return ((block && `.${block.getAttribute('data-block-name')}`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-rum-enhancer",
3
- "version": "2.33.0",
3
+ "version": "2.34.1",
4
4
  "description": "Helix RUM Enhancer",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -34,13 +34,14 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@adobe/eslint-config-helix": "2.0.9",
37
- "@adobe/helix-rum-js": "2.10.1",
37
+ "@adobe/helix-rum-js": "2.10.5",
38
38
  "@esm-bundle/chai": "4.3.4-fix.0",
39
39
  "@rollup/plugin-babel": "6.0.4",
40
40
  "@semantic-release/changelog": "6.0.3",
41
+ "@semantic-release/exec": "7.0.3",
41
42
  "@semantic-release/git": "10.0.1",
42
43
  "@semantic-release/npm": "12.0.1",
43
- "@web/test-runner": "0.20.0",
44
+ "@web/test-runner": "0.20.1",
44
45
  "@web/test-runner-commands": "0.9.0",
45
46
  "@web/test-runner-junit-reporter": "0.8.0",
46
47
  "@web/test-runner-mocha": "0.9.0",
@@ -53,10 +54,10 @@
53
54
  "husky": "9.1.7",
54
55
  "jsdoc-to-markdown": "9.1.1",
55
56
  "junit-report-builder": "5.1.1",
56
- "lint-staged": "15.5.0",
57
+ "lint-staged": "15.5.1",
57
58
  "mocha": "11.1.0",
58
59
  "mocha-multi-reporters": "1.5.1",
59
- "rollup": "4.36.0",
60
+ "rollup": "4.40.0",
60
61
  "rollup-plugin-checksum": "1.0.1",
61
62
  "rollup-plugin-eslint-bundle": "9.0.0",
62
63
  "semantic-release": "24.2.3",
package/src/index.js CHANGED
@@ -80,7 +80,10 @@
80
80
  const formEl = el.closest('form');
81
81
  if (formEl) {
82
82
  const id = formEl.getAttribute('id');
83
- return `form${id ? `#${id}` : ''}`;
83
+ if (id) {
84
+ return `form#${id}`;
85
+ }
86
+ return `form${formEl.classList.length > 0 ? `.${formEl.classList[0]}` : ''}`;
84
87
  }
85
88
  const block = el.closest('.block[data-block-name]');
86
89
  return block && `.${block.getAttribute('data-block-name')}` || walk(el, isDialog) && 'dialog' || ['nav', 'header', 'footer', 'aside'].find(t => el.closest(t)) || walk(el, e => e.id && `#${e.id}`);
package/src/index.md5 CHANGED
@@ -1 +1 @@
1
- aaf6f6e0e4ff60b53769f7deead28f2a
1
+ ec0f8d360b4b5a3f5b5b84ff90cd98cc
@@ -1 +1 @@
1
- 866b5825b7bdb273170fbab6fa8099bb
1
+ 65c04c4661e32005cec85954ff308008
@@ -1 +1 @@
1
- 5335d59147580bf5f51b609e1ce676b3
1
+ 517639c5549d69645ca8d34d41e99914
package/tagger.sh ADDED
@@ -0,0 +1,173 @@
1
+ #!/bin/bash
2
+
3
+ # Check if at least one argument is provided
4
+ if [ $# -lt 1 ]; then
5
+ echo "Usage: $0 <version> [paths...] [--push]"
6
+ echo "Example: $0 2.3.4 path/to/dir1 path/to/file2 --push"
7
+ exit 1
8
+ fi
9
+
10
+ # Extract version number (first argument)
11
+ VERSION=$1
12
+ shift
13
+
14
+ # Initialize variables
15
+ PUSH=false
16
+ PATHS=()
17
+
18
+ # Process remaining arguments
19
+ while [ $# -gt 0 ]; do
20
+ case "$1" in
21
+ --push)
22
+ PUSH=true
23
+ echo "Push flag enabled: branches will be force-pushed to origin"
24
+ ;;
25
+ *)
26
+ PATHS+=("$1")
27
+ ;;
28
+ esac
29
+ shift
30
+ done
31
+
32
+ # Configure branch prefix
33
+ PREFIX="release"
34
+
35
+ # Convert version to branch name by replacing non-alphanumeric chars with dashes
36
+ EXACT_BRANCH_NAME="${PREFIX}-$(echo $VERSION | sed 's/[^[:alnum:]]/-/g')"
37
+
38
+ # Check if version is a pure semver without suffixes (like 2.3.4 without -rc1 etc.)
39
+ if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
40
+ # Extract major, minor, and patch components
41
+ MAJOR=$(echo $VERSION | cut -d. -f1)
42
+ MINOR=$(echo $VERSION | cut -d. -f2)
43
+ PATCH=$(echo $VERSION | cut -d. -f3)
44
+
45
+ # Create specialized branch names
46
+ PATCH_BRANCH_NAME="${PREFIX}-${MAJOR}-${MINOR}-${PATCH}"
47
+ MINOR_BRANCH_NAME="${PREFIX}-${MAJOR}-${MINOR}-x"
48
+ MAJOR_BRANCH_NAME="${PREFIX}-${MAJOR}-x"
49
+ else
50
+ # For versions with suffixes, these specialized branches aren't created
51
+ PATCH_BRANCH_NAME=""
52
+ MINOR_BRANCH_NAME=""
53
+ MAJOR_BRANCH_NAME=""
54
+ fi
55
+
56
+ # Output extracted parameters
57
+ echo "Version: $VERSION"
58
+ echo "Exact branch name: $EXACT_BRANCH_NAME"
59
+ if [[ -n $PATCH_BRANCH_NAME ]]; then
60
+ echo "Patch branch name: $PATCH_BRANCH_NAME"
61
+ echo "Minor branch name: $MINOR_BRANCH_NAME"
62
+ echo "Major branch name: $MAJOR_BRANCH_NAME"
63
+ fi
64
+ echo "Push flag: $PUSH"
65
+ echo "Number of paths: ${#PATHS[@]}"
66
+ if [ ${#PATHS[@]} -gt 0 ]; then
67
+ echo "Paths:"
68
+ for path in "${PATHS[@]}"; do
69
+ echo " - $path"
70
+ done
71
+ fi
72
+
73
+ # Store the current branch name
74
+ CURRENT_BRANCH=$(git branch --show-current)
75
+
76
+ # Create a temporary directory only if we have files to copy
77
+ if [ ${#PATHS[@]} -gt 0 ]; then
78
+ # Create a temporary directory to store copies of the files
79
+ TEMP_DIR=$(mktemp -d)
80
+ echo "Creating temporary copies of files at $TEMP_DIR"
81
+
82
+ # Copy all specified files to the temporary directory
83
+ for path in "${PATHS[@]}"; do
84
+ # Create directory structure in temp dir
85
+ mkdir -p "$TEMP_DIR/$(dirname "$path")"
86
+ # Copy the file
87
+ cp "$path" "$TEMP_DIR/$path"
88
+ echo "Copied $path to $TEMP_DIR/$path"
89
+ done
90
+ fi
91
+
92
+ # Create commit message
93
+ COMMIT_MSG="Update for version $VERSION"
94
+
95
+ # Function to create or update a branch and commit changes
96
+ create_or_update_branch() {
97
+ local branch_name=$1
98
+
99
+ echo "Processing branch: $branch_name"
100
+
101
+ # Check if branch exists
102
+ if git show-ref --verify --quiet refs/heads/$branch_name; then
103
+ # Branch exists, reset it from main
104
+ echo "Branch $branch_name exists, resetting from main..."
105
+ git checkout main
106
+ git branch -D $branch_name
107
+ git checkout -b $branch_name
108
+ else
109
+ # Create new branch from main
110
+ echo "Creating new branch $branch_name from main..."
111
+ git checkout main
112
+ git checkout -b $branch_name
113
+ fi
114
+
115
+ # Copy files from temp directory back to working directory if we have any
116
+ if [ ${#PATHS[@]} -gt 0 ]; then
117
+ for path in "${PATHS[@]}"; do
118
+ # Create directory structure if needed
119
+ mkdir -p "$(dirname "$path")"
120
+ # Copy the file back from temp
121
+ cp "$TEMP_DIR/$path" "$path"
122
+ echo "Restored $path from $TEMP_DIR/$path"
123
+ done
124
+
125
+ # Add files to git, even if they're in .gitignore
126
+ echo "Adding files to git staging area in branch $branch_name..."
127
+ for path in "${PATHS[@]}"; do
128
+ git add --force "$path"
129
+ done
130
+
131
+ # Commit changes
132
+ git commit -m "$COMMIT_MSG"
133
+ else
134
+ # Create an empty commit when no files are specified
135
+ git commit --allow-empty -m "$COMMIT_MSG"
136
+ fi
137
+
138
+ # Push if requested
139
+ if [ "$PUSH" = true ]; then
140
+ echo "Force-pushing branch $branch_name to origin..."
141
+ git push -f origin $branch_name
142
+ echo "Successfully pushed $branch_name to origin."
143
+ fi
144
+ }
145
+
146
+ # Process each branch
147
+ echo "Creating/updating branches and committing changes..."
148
+
149
+ # Always process the exact branch
150
+ create_or_update_branch $EXACT_BRANCH_NAME
151
+
152
+ # Process other branches if they exist
153
+ if [[ -n $PATCH_BRANCH_NAME ]]; then
154
+ create_or_update_branch $PATCH_BRANCH_NAME
155
+ create_or_update_branch $MINOR_BRANCH_NAME
156
+ create_or_update_branch $MAJOR_BRANCH_NAME
157
+ fi
158
+
159
+ # Clean up temporary directory if it was created
160
+ if [ ${#PATHS[@]} -gt 0 ]; then
161
+ echo "Cleaning up temporary files..."
162
+ rm -rf "$TEMP_DIR"
163
+ fi
164
+
165
+ # Return to the original branch
166
+ echo "Returning to original branch: $CURRENT_BRANCH"
167
+ git checkout $CURRENT_BRANCH
168
+
169
+ if [ "$PUSH" = true ]; then
170
+ echo "All branches have been force-pushed to origin."
171
+ fi
172
+
173
+ echo "Done!"