Skip to content

Update deps#852

Open
MartinKolarik wants to merge 8 commits into
masterfrom
deps
Open

Update deps#852
MartinKolarik wants to merge 8 commits into
masterfrom
deps

Conversation

@MartinKolarik
Copy link
Copy Markdown
Member

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 212571ab-5228-4c63-a944-6541ea5370f1

📥 Commits

Reviewing files that changed from the base of the PR and between 14ac62f and b378217.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json

Walkthrough

This PR replaces legacy ESLint files with flat configs (eslint.config.js and eslint-html.config.js), updates package.json scripts and dependency versions, and bumps Actions steps. It removes unused catch parameters across many source files, changes synchronous font loading to parse file buffers, and adds async wait helpers in test/utils.js while refactoring Selenium package tests to use explicit waits.

🚥 Pre-merge checks | ✅ 2 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided by the author, making it impossible to assess whether the changes are adequately documented or justified. Add a description explaining the purpose of the dependency updates, the migration to ESLint flat config, test refactoring improvements, and any breaking changes or migration notes for reviewers.
Title check ❓ Inconclusive The title 'Update deps' is overly vague and does not clearly convey what dependencies were updated or why, failing to provide meaningful information about the changeset scope. Consider a more descriptive title such as 'Update dependencies and migrate to ESLint flat config' to better represent the scope and nature of changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deps

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
test/utils.js (1)

22-35: ⚡ Quick win

Return the matched element directly from the wait condition.

Both helpers validate one element and then re-query a potentially different one. In dynamic DOM states this can make waits pass but return the wrong node.

Proposed diff
 module.exports.waitForText = async (browser, locator, expectedText, timeout = DEFAULT_WAIT_TIMEOUT) => {
-	await browser.wait(async () => {
+	return browser.wait(async () => {
 		let elements = await browser.findElements(locator);

 		if (!elements.length) {
 			return false;
 		}

-		let text = await elements[0].getText();
-		return text.includes(expectedText);
+		for (let element of elements) {
+			let text = await element.getText();
+			if (text.includes(expectedText)) {
+				return element;
+			}
+		}
+
+		return false;
 	}, timeout);
-
-	return browser.findElement(locator);
 };

 module.exports.waitForAttribute = async (browser, locator, attribute, expectedValue, timeout = DEFAULT_WAIT_TIMEOUT) => {
-	await browser.wait(async () => {
+	return browser.wait(async () => {
 		let elements = await browser.findElements(locator);

 		if (!elements.length) {
 			return false;
 		}

-		let value = await elements[0].getAttribute(attribute);
-		return value === expectedValue;
+		for (let element of elements) {
+			let value = await element.getAttribute(attribute);
+			if (value === expectedValue) {
+				return element;
+			}
+		}
+
+		return false;
 	}, timeout);
-
-	return browser.findElement(locator);
 };

Also applies to: 37-50

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/utils.js` around lines 22 - 35, The waitForText helper currently
re-queries the DOM after the wait and can return a different element; change
waitForText (in test/utils.js) so the browser.wait callback captures and returns
the matching element (the found element that contains expectedText) and then
have waitForText return that captured element instead of calling
browser.findElement again; apply the same change to the sibling helper at lines
~37-50 to return the element instance obtained during the wait rather than
re-querying.
package.json (1)

161-161: ⚡ Quick win

Align CI test matrix with declared Node engine support

Line 161 declares Node 22 and 24 support, but CI currently validates only 24.x. Add 22.x to the workflow matrix to enforce the contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 161, CI currently only tests Node 24.x while
package.json's engines field ("node": "22 || 24") promises Node 22 support;
update the workflow's test matrix to include Node 22.x. Locate the GitHub
Actions job that defines the matrix (e.g., matrix.node-version or the test job
matrix in the CI workflow) and add "22.x" alongside "24.x" so both versions are
run, ensuring any matrix aliases (node-version, node) match the engines string;
commit the updated workflow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 153-154: The lint-staged config currently runs HTML files twice
because the glob "*.{html,js}" overlaps with "*.html"; update the mixed glob to
only target JS so HTML is handled by the HTML-specific command: change the "*.
{html,js}" entry in package.json's lint-staged to only include JS (e.g.,
"*.{js}") so staged HTML files are no longer matched by both "*. {html,js}" and
"*.html".

In `@src/middleware/open-graph/image/fonts.js`:
- Line 22: The code calls opentype.parse with a Node Buffer (font =
opentype.parse(fs.readFileSync(fontPath))) which v2.x expects to be an
ArrayBuffer; replace that direct call by reading the file into a Buffer and
converting it to an ArrayBuffer before calling opentype.parse (e.g., get the
Buffer from fs.readFileSync(fontPath), then create an ArrayBuffer view of the
buffer data) so opentype.parse receives an ArrayBuffer; update the use site
where font is assigned (font variable and any code that calls opentype.parse
with fs.readFileSync(fontPath)) to perform this conversion.

In `@test/tests/package.js`:
- Around line 39-47: The test opens a second tab (via openFilesTab +
browser.getAllWindowHandles()) then makes assertions but doesn't guarantee
cleanup if the assertion throws; wrap the interaction after obtaining tabs (the
code that switches to tabs[1], waits for 'pre', and asserts its text) in a
try/finally so that in the finally block you always close the second window
(browser.close()) if it exists and switch back to the original window
(browser.switchTo().window(tabs[0])); ensure you check that tabs.length > 1
before closing/switching to avoid errors.

---

Nitpick comments:
In `@package.json`:
- Line 161: CI currently only tests Node 24.x while package.json's engines field
("node": "22 || 24") promises Node 22 support; update the workflow's test matrix
to include Node 22.x. Locate the GitHub Actions job that defines the matrix
(e.g., matrix.node-version or the test job matrix in the CI workflow) and add
"22.x" alongside "24.x" so both versions are run, ensuring any matrix aliases
(node-version, node) match the engines string; commit the updated workflow.

In `@test/utils.js`:
- Around line 22-35: The waitForText helper currently re-queries the DOM after
the wait and can return a different element; change waitForText (in
test/utils.js) so the browser.wait callback captures and returns the matching
element (the found element that contains expectedText) and then have waitForText
return that captured element instead of calling browser.findElement again; apply
the same change to the sibling helper at lines ~37-50 to return the element
instance obtained during the wait rather than re-querying.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 15c55092-bee7-48b0-a653-3843a516a9f9

📥 Commits

Reviewing files that changed from the base of the PR and between bf1f52a and 14ac62f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (17)
  • .eslintrc
  • .eslintrc-html
  • .github/workflows/nodejs.yml
  • eslint-html.config.js
  • eslint.config.js
  • package.json
  • src/assets/js/_.js
  • src/assets/js/app-docs.js
  • src/assets/js/app.js
  • src/assets/js/utils/has.js
  • src/assets/js/utils/is-url-valid.js
  • src/lib/assets/index.js
  • src/middleware/open-graph/image/fonts.js
  • src/proxy.js
  • src/routes/debug.js
  • test/tests/package.js
  • test/utils.js
💤 Files with no reviewable changes (2)
  • .eslintrc-html
  • .eslintrc

Comment thread package.json
Comment thread src/middleware/open-graph/image/fonts.js
Comment thread test/tests/package.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants