Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): migrate to husky 9.0.6 #786

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

MikeMcC399
Copy link
Collaborator

This PR migrates from [email protected] to [email protected]. Husky provides support for Git Hooks.

To avoid the error [ERR_REQUIRE_ESM] when installing dependencies after the upgrade, scripts/prepare.js is migrated to .husky/install.mjs according to the recommendations in Husky > CI server and Docker.

require('husky') used for Husky 8 is replaced by import('husky') needed for Husky 9.

The following lines are removed from .husky/pre-commit. These are not needed in Husky 9:

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

Local Verification

On a local Ubuntu 22.04 system (not a CI system) with Node.js 20 ...

Installation

Execute:

git clean -x -f -d
npm ci

Ensure that there are no errors or deprecation warnings. The following log lines should be displayed:

[email protected] prepare
node .husky/install.mjs

Hook check

Make a change to cypress/e2e/1-getting-started/todo.cy.js (for instance, add // comment as a new line at the end of the file) and commit the change.

Ensure that the Husky hook runs successfully with the following output:

> [email protected] lint
> eslint --fix cypress app/assets/js/scripts.js


> [email protected] lint:yaml
> yamllint '*.yml' '.buildkite/*.yml' '.circleci/*.yml' '.github/workflows/*.yml' '.semaphore/*.yml' 'basic/**/*.yml'

√ YAML Lint successful.

CI verification

Manually run GitHub workflow chrome-docker.yml and under step Chrome check that the following appears, with no errors from Husky:

[email protected] prepare
node .husky/install.mjs

References

@cypress-app-bot
Copy link
Collaborator

@MikeMcC399 MikeMcC399 marked this pull request as ready for review January 28, 2024 16:11
@jennifer-shehane jennifer-shehane merged commit 0eaf7a9 into cypress-io:master Feb 2, 2024
12 checks passed
@MikeMcC399 MikeMcC399 deleted the migrate/husky-9 branch February 2, 2024 17:37
@cypress-app-bot
Copy link
Collaborator

🎉 This PR is included in version 2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants