reg-viz / reg-suit

:recycle: Visual Regression Testing tool
https://reg-viz.github.io/reg-suit
MIT License
1.17k stars 101 forks source link

[Feature] add init option --use-pnpm #624

Open NaokiHaba opened 11 months ago

NaokiHaba commented 11 months ago

What does this change?

The following error occurred when running reg-suit init with pnpm

This PR change allows pnpm users to also run reg-suit init

We need your opinions! Please feel free to comment here. Thank you 🙇

References

When I run reg-suit init with pnpm I get the following error

$ reg-suit init

[reg-suit] info version: 0.12.2
? Plugin(s) to install (bold: recommended)  reg-keygen-git-hash-plugin : Detect the snapshot key to be compare with using Git hash.,  reg-notify-github-plugin : Notify reg-suit result to GitHub repository,  reg-publish-
s3-plugin : Fetch and publish snapshot images to AWS S3.
[reg-suit] info Install dependencies to the local directory. This procedure takes some minutes, please wait.
◵ installing dependencies with npm...Error: Command failed: npm install -D reg-keygen-git-hash-plugin reg-notify-github-plugin reg-publish-s3-plugin
npm ERR! Cannot read properties of null (reading 'matches')

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/naoki.haba/.npm/_logs/2023-11-16T09_28_44_283Z-debug-0.log

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'npm install -D reg-keygen-git-hash-plugin reg-notify-github-plugin reg-publish-s3-plugin'
}

Screenshots

➜  reg-suit git:(master) ✗ node packages/reg-suit-cli/lib/cli.js init --use-pnpm
[reg-suit] info version: 0.12.2
? Plugin(s) to install (bold: recommended) (Press <space> to select, <a> to toggle all, <i> to invert select
ion, and <enter> to proceed)
❯◉  reg-keygen-git-hash-plugin : Detect the snapshot key to be compare with using Git hash.
 ◉  reg-notify-github-plugin : Notify reg-suit result to GitHub repository
 ◉  reg-publish-s3-plugin : Fetch and publish snapshot images to AWS S3.
 ◯  reg-notify-chatwork-plugin : Notify reg-suit result to Chatwork channel.
 ◯  reg-notify-github-with-api-plugin : Notify reg-suit result to GHE repository using API
 ◯  reg-notify-gitlab-plugin : Notify reg-suit result to GitLab repository
 ◯  reg-notify-slack-plugin : Notify reg-suit result to Slack channel.
(Move up and down to reveal more choices)
➜  reg-suit git:(master) ✗ 
➜  reg-suit git:(master) ✗                                                      
➜  reg-suit git:(master) ✗ node packages/reg-suit-cli/lib/cli.js init --use-pnpm
[reg-suit] info version: 0.12.2
? Plugin(s) to install (bold: recommended)  reg-keygen-git-hash-plugin : Detect the snapshot key to be compa
re with using Git hash.,  reg-notify-github-plugin : Notify reg-suit result to GitHub repository,  reg-publi
sh-s3-plugin : Fetch and publish snapshot images to AWS S3.
[reg-suit] info Install dependencies to the local directory. This procedure takes some minutes, please wait.
? Working directory of reg-suit. .reg
? Append ".reg" entry to your .gitignore file. No
? Directory contains actual images. directory_contains_actual_images
? Threshold, ranges from 0 to 1. Smaller value makes the comparison more sensitive. 0
[reg-suit] info Set up reg-notify-github-plugin:
? notify-github plugin requires a client ID of reg-suit GitHub app. Open installation window in your browser
 (Y/n) (node:68873) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
? notify-github plugin requires a client ID of reg-suit GitHub app. Open installation window in your browser
 Yes
? This repositoriy's client ID of reg-suit GitHub app 
[reg-suit] info Set up reg-publish-s3-plugin:
? Create a new S3 bucket No
? Existing bucket name 
[reg-suit] info Configuration:
[reg-suit] info {
  "core": {
    "workingDir": ".reg",
    "actualDir": "directory_contains_actual_images",
    "thresholdRate": 0,
    "addIgnore": false,
    "ximgdiff": {
      "invocationType": "client"
    }
  },
  "plugins": {
    "reg-keygen-git-hash-plugin": true,
    "reg-notify-github-plugin": {
      "prComment": true,
      "prCommentBehavior": "default",
      "clientId": ""
    },
    "reg-publish-s3-plugin": {
      "bucketName": ""
    }
  }
}
? Update configuration file No
? Copy sample images to working dir No
[reg-suit] info Initialization ended successfully ✨
[reg-suit] info Put your images files into /Users/naoki.haba/Documents/reg-suit/directory_contains_actual_images.

What can I check for bug fixes?

$ reg-suit init --use-pnpm