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

⬆️ Update dev dependencies #185

Merged
merged 97 commits into from
Mar 12, 2023
Merged

⬆️ Update dev dependencies #185

merged 97 commits into from
Mar 12, 2023

Conversation

sounisi5011
Copy link
Owner

No description provided.

lefthook is made using the Golang, so it works with older Node.js.
Executing `npx run-s ...` command fails and never exits.
This command is the same as the `npm run ...` command except that the glob pattern cannot be used, so use the `npm run ...` command.
Lefthook can set the process to be "executed after all the parallel execution processes are finished".
see evilmartians/lefthook#66 (comment)
npm v7 is the latest version of npm that supports Node.js v10.
npm v8 and later no longer support Node.js 10.
Also, the latest npm overwrites `package-lock.json` files with forward incompatible `lockfileVersion: 3`.

So we specified the version of npm to be used for this project.
If the contributor is using Node.js 14.19 or later, the version of npm CLI should be automatically switched by Corepack.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 10079 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 10079 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 15588 lines exceeds the maximum allowed for the inline comments feature.

…tions

npm uses the `ssh:` protocol when installing npm packages with the `github:` protocol specified.
However, on GitHub Actions, the dependency installation fails with the following error:

    npm ERR! Error while executing:
    npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/sounisi5011/readme-generator.git
    npm ERR!
    npm ERR! git@github.com: Permission denied (publickey).
    npm ERR! fatal: Could not read from remote repository.
    npm ERR!
    npm ERR! Please make sure you have the correct access rights
    npm ERR! and the repository exists.
    npm ERR!
    npm ERR! exited with error code: 128

To resolve this, "Reconfigure git to use HTTP authentication" steps have been added.

see https://stackoverflow.com/a/69634516
see actions/setup-node#214 (comment)
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 15248 lines exceeds the maximum allowed for the inline comments feature.

In PowerShell, backslash cannot be used for line breaks in commands.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 15250 lines exceeds the maximum allowed for the inline comments feature.

Prettier's auto-formatting changed the location of a comment to an unintended location.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 15256 lines exceeds the maximum allowed for the inline comments feature.

`corepack enable npm` command does not activate npm shims.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 15256 lines exceeds the maximum allowed for the inline comments feature.

…e.js)" jobs

+ Execute both `corepack enable` and `corepack enable npm` commands

    `corepack enable` command does not activate npm shims.
    However, just executing the `corepack enable npm` command does not prevent the use of yarn or pnpm.

+ If Corepack is not builtin to Node.js, install it

    Corepack is already installed on GitHub Actions.
    But it does not manage npm versions.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 15274 lines exceeds the maximum allowed for the inline comments feature.

+ Replace the `npx --no-install ...` command with the `npm exec --no ...` command

    In npm v7, the npx command throws the following error:

        Command failed: .../bin/node .../npm/7.24.2/bin/npx-cli.js config get tag-version-prefix
        npm ERR! could not determine executable to run

+ In tests using yarn, set `"packageManager": "yarn@1.22.19"` within package.json

    If Corepack is enabled, the `yarn` command cannot be used.
    This problem can be resolved by specifying the `packageManager` field for package.json in the temporary directory.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 15287 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 15291 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 15314 lines exceeds the maximum allowed for the inline comments feature.

We will not update to v5 because we cannot yet use ESM for unit testing on this project.
Perhaps this is not available in Node.js 14.0.0.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 17271 lines exceeds the maximum allowed for the inline comments feature.

We will not use v6 or later because the ESM cannot yet be used for unit testing in this project.
Perhaps this is not available in Node.js 14.0.0.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 17184 lines exceeds the maximum allowed for the inline comments feature.

This project supports Node.js 14.0.0 so we will not update to v5 which is not available in Node.js 14.0.0.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 17185 lines exceeds the maximum allowed for the inline comments feature.

This project supports Node.js 14.0.0 so we will not update to v4 or later which is not available in Node.js 14.0.0.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 17139 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 17155 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 17156 lines exceeds the maximum allowed for the inline comments feature.

@sounisi5011 sounisi5011 marked this pull request as ready for review March 12, 2023 05:45
github-actions[bot]
github-actions bot previously approved these changes Mar 12, 2023
+ Execute `git add {staged_files}` command only once at last

    No need to run `git add` each time with each command.

+ Not formatting ".ts" and ".js" files using Prettier

    Since ESLint uses Prettier, there is no need to use the `prettier --write ...` command for these files.
The purpose of this pull request is not to refactor the test code.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 17042 lines exceeds the maximum allowed for the inline comments feature.

@codeclimate
Copy link

codeclimate bot commented Mar 12, 2023

Code Climate has analyzed commit 436b28d and detected 0 issues on this pull request.

View more on Code Climate.

@sounisi5011 sounisi5011 merged commit db40a85 into master Mar 12, 2023
@sounisi5011 sounisi5011 deleted the update-dev-deps branch March 12, 2023 13:38
sounisi5011 added a commit that referenced this pull request Mar 12, 2023
This update should have been done within #185
sounisi5011 added a commit that referenced this pull request Mar 12, 2023
* 🔧 Update `.renovaterc.json` file

    This update should have been done within #185

* 🔧 Rewrite `.renovaterc.json` to JSON5

* 📝 Update CHANGELOG

* 🔧 Disable major npm updates by Renovate bot
sounisi5011 added a commit that referenced this pull request Mar 12, 2023
This step was added with #185.
However, perhaps if we run `npm config get prefix >> "${GITHUB_PATH}"`, we can update npm with the `npm install --global npm` command.
sounisi5011 added a commit that referenced this pull request Mar 13, 2023
Old Corepack throws ENOTEMPTY errors (or EPERM errors on Windows) when running package managers in parallel.
To fix this, update the old Corepack when it is detected.
see nodejs/corepack#110
see nodejs/corepack#84

---------

* 💚 [Debug] Try to switch package managers using Corepack in all Node.js

* 💚 [Debug] Run the package manager multiple times

* 💚 [Debug] Using the Package Manager in Test

* 💚 [Debug] Run package managers in parallel

* 💚 Update old Corepack that throws ENOTEMPTY error

    Old Corepack throws ENOTEMPTY error when running package managers in parallel.
    This has been fixed in Corepack v0.11, so if the old Corepack is detected, this will be updated.

* 💚 Include "XXXXXXXXXXXXX" in the argument of the `mktemp` command

    The `mktemp` command on GitHub Actions seems to require the specification of the X's.

* 💚 Also detects EPERM errors thrown by Corepack

    On Windows, the old Corepack seems to throw EPERM errors instead of ENOTEMPTY errors.

* 💚 Modify comments in shell scripts

* 💚 Allow updated Corepack to be used on Windows

    > ```yaml
    > # Windows installs global packages to a directory that has lower priority than
    > # the default node install so we also need to edit $PATH
    > ```
    > Source: https://github.com/vercel/turbo/pull/1632/files#diff-b92a3120126a9ffe46d7d5ec3a8496ef1eac951db09e1972fac7c78438e36c42R62-R63

    > ```bash
    > npm config get prefix >> $GITHUB_PATH
    > ```
    > Source: https://github.com/vercel/turbo/pull/1632/files#diff-b92a3120126a9ffe46d7d5ec3a8496ef1eac951db09e1972fac7c78438e36c42R69

* 💚 Update npm without using npm-windows-upgrade

    This step was added with #185.
    However, perhaps if we run `npm config get prefix >> "${GITHUB_PATH}"`, we can update npm with the `npm install --global npm` command.

* 💚 [Debug] Try updating npm on Windows without updating the environment variable `$PATH`

* ⏪ Revert "💚 [Debug] Try to switch package managers using Corepack in all Node.js"

    This reverts commit 5b4ec7c, 3a62968, 977b430, and 281b88a.

* ✅ [Debug] Verify npm version

* ⏪ Revert "✅ [Debug] Verify npm version"

    This reverts commit c9ddd9d.

* ✅ [Debug] Verify npm version

* ⏪ Revert "💚 [Debug] Try updating npm on Windows without updating the environment variable `$PATH`"

    This reverts commit 919029c.

* 💚 Modify the display content of "Enable Corepack" job

* 💚 Use the prefix "[command]" together with the command `sleep 1`

* 💚 Use the `node -e 'setTimeout(()=>0,10)'` command instead of the `sleep 1` command

    Waiting two seconds just to correct a display shift is a waste of time.
    Note: The POSIX-compliant `sleep` command has a minimum of one second, so we use the `node` command instead.

* 💚 [Debug] Try updating npm on Windows without updating the environment variable `$PATH`

* ⏪ Revert "💚 [Debug] Try updating npm on Windows without updating the environment variable `$PATH`"

    This reverts commit 96914e1.

* ⏪ Revert "✅ [Debug] Verify npm version"

    This reverts commit 70250e2.

* 💚 Modify the display content of "Enable Corepack" job

* 💚 Rewrite `exec_with_debug` function from Bash to Node.js

* 💚 Fix the bash here-document

* 💚 [Debug] Try updating npm on Windows without updating the environment variable `$PATH`

* ⏪ Revert "💚 [Debug] Try updating npm on Windows without updating the environment variable `$PATH`"

    This reverts commit 481b3a0.

* 💚 Wrap complex code that detects old Corepack in a function

* 💚 [Debug] Try to switch package managers using Corepack in all Node.js

* 💚 [Debug] Try without updating old Corepack

* ⏪ Revert "💚 [Debug] Try without updating old Corepack"

    This reverts commit 1631259.

* ⏪ Revert "💚 [Debug] Try to switch package managers using Corepack in all Node.js"

    This reverts commit 6fd6ece.

* 📝 Update CHANGELOG
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.

1 participant