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
Show file tree
Hide file tree
Changes from 94 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
be5e285
⬆️ Update dependency husky to 8.0.3
sounisi5011 Mar 5, 2023
f4d5bc5
➕ Migrating from husky and lint-staged to lefthook
sounisi5011 Mar 5, 2023
a7c7aab
Use the `npm run ...` command instead of the `npx run-s ...` command
sounisi5011 Mar 5, 2023
a32a94d
🔧 Parallel execution of automatic formatting
sounisi5011 Mar 5, 2023
6e3ebb2
🔧 Use npm v7 in this project
sounisi5011 Mar 5, 2023
ac79c98
Merge branch 'master' into update-dev-deps
sounisi5011 Mar 6, 2023
96eca22
👽 Regenerate package-lock.json
sounisi5011 Mar 8, 2023
56a426b
📌 Fix dependency version: pin "cac" package version to 6.6.1
sounisi5011 Mar 8, 2023
b926848
🔧 Regenerate package-lock.json
sounisi5011 Mar 8, 2023
01c49f6
💚 Using npm packages installed by the `github:` protocol on GitHub Ac…
sounisi5011 Mar 8, 2023
f47ee01
💚 Use bash in "Reconfigure git to use HTTP authentication" steps
sounisi5011 Mar 8, 2023
24791b6
💚 Enable Corepack on GitHub actions
sounisi5011 Mar 8, 2023
0b6c306
💚 Fix the location of comments in the .github/workflows/ci.yaml file
sounisi5011 Mar 8, 2023
49012fa
💚 Manage npm with Corepack
sounisi5011 Mar 8, 2023
fe96a2c
💚 Fix "Enable Corepack (Automatically setup a package manager for Nod…
sounisi5011 Mar 8, 2023
99c80c7
✅ Fix the test code
sounisi5011 Mar 8, 2023
190fc1a
💚 Avoid ENOTEMPTY errors thrown by Corepack
sounisi5011 Mar 8, 2023
98f4ad8
💚 Explore why built-in Corepack cannot be detected on Windows
sounisi5011 Mar 8, 2023
d8217a1
💚 Explore why built-in Corepack cannot be detected on Windows
sounisi5011 Mar 8, 2023
c761b77
⏪ Revert "💚 Explore why built-in Corepack cannot be detected on Windows"
sounisi5011 Mar 8, 2023
a3a73d7
💚 Fix conditional expression to detect builtin Corepack
sounisi5011 Mar 8, 2023
1d9f512
💚 Find out why builtin Corepack detection fails
sounisi5011 Mar 8, 2023
9891794
💚 Find out why builtin Corepack detection fails
sounisi5011 Mar 8, 2023
3d1b09b
💚 Find out why builtin Corepack detection fails
sounisi5011 Mar 8, 2023
c6e906b
💚 Find out why builtin Corepack detection fails
sounisi5011 Mar 8, 2023
8e36a27
💚 Find out why builtin Corepack detection fails
sounisi5011 Mar 8, 2023
af9b90d
💚 Find out why builtin Corepack detection fails
sounisi5011 Mar 8, 2023
390fb97
💚 Fix conditional expression to detect builtin Corepack
sounisi5011 Mar 8, 2023
06b5a82
⏪ Revert "💚 Find out why builtin Corepack detection fails"
sounisi5011 Mar 8, 2023
7b84060
💚 Fix Corepack installation failure on Windows
sounisi5011 Mar 8, 2023
fd5019a
💚 Modify the shell script for the "Enable Corepack" step
sounisi5011 Mar 8, 2023
273c4d2
💚 Fix problem with npm version not changing on Windows
sounisi5011 Mar 8, 2023
349c11a
💚 If Corepack is not available, manually update npm
sounisi5011 Mar 8, 2023
40e7f57
💚 If Corepack is not available, disable Corepack
sounisi5011 Mar 8, 2023
c90dc30
💚 Modify the print content of the "Enable Corepack" step
sounisi5011 Mar 8, 2023
b6915cc
💚 Add comments for future contributors within the "Enable Corepack" s…
sounisi5011 Mar 8, 2023
671d93c
💚 If yarn is not available, install it
sounisi5011 Mar 8, 2023
2636d39
⬆️ Update dependency ava to 3.15.0
sounisi5011 Mar 8, 2023
96d9df4
⬆️ Update dependency typescript to 4.9.5
sounisi5011 Mar 8, 2023
5120a32
⬆️ Update dependencies: eslint packages
sounisi5011 Mar 8, 2023
4cae4c5
⬆️ Update dependency node-git-server to 1.0.0
sounisi5011 Mar 8, 2023
457375c
⬆️ Update dependency ts-node to 10.9.1
sounisi5011 Mar 8, 2023
1b1634b
🔧 Use `@typescript-eslint/recommended-requiring-type-checking` and `@…
sounisi5011 Mar 8, 2023
3d41523
♻️ Fix code following new TypeScript and ESLint reports
sounisi5011 Mar 8, 2023
ed03e3b
🔧 Fix patch file to make `check-peer-deps@1.1.3` detect peerDependenc…
sounisi5011 Mar 10, 2023
d77c9a3
✅ Display npm version during test run
sounisi5011 Mar 10, 2023
0968bd1
🔧 Increase test timeout to 5 minutes
sounisi5011 Mar 10, 2023
89d0d2e
✅ Use `execa` instead of `cross-spawn`
sounisi5011 Mar 10, 2023
dceda8c
💚 [Debug] Check npm version in different shells
sounisi5011 Mar 10, 2023
fe976f0
💚 [Debug] Check npm version using execa
sounisi5011 Mar 10, 2023
59ae401
💚 [Debug] Display the path where the npm command exists
sounisi5011 Mar 10, 2023
e060ff9
💚 On Windows, update npm using `npm-windows-upgrade`
sounisi5011 Mar 11, 2023
720dc24
💚 Run `npm-windows-upgrade` using the `npx` command
sounisi5011 Mar 11, 2023
028ed18
💚 [Debug] Try `npm install --global ...` command instead of `npm-wind…
sounisi5011 Mar 11, 2023
b3072a8
⏪ Revert "💚 [Debug] Try `npm install --global ...` command instead of…
sounisi5011 Mar 11, 2023
a584ba7
⏪ Revert "💚 [Debug] Display the path where the npm command exists"
sounisi5011 Mar 11, 2023
3122b27
⏪ Revert "💚 [Debug] Check npm version using execa"
sounisi5011 Mar 11, 2023
2a64ee6
⏪ Revert "💚 [Debug] Check npm version in different shells"
sounisi5011 Mar 11, 2023
d877712
⏪ Revert "✅ Display npm version during test run"
sounisi5011 Mar 11, 2023
345827c
💚 Move "Update to the specified npm (on Windows)" steps before "Updat…
sounisi5011 Mar 11, 2023
78287d0
💚 Rename the steps for install the specified npm
sounisi5011 Mar 11, 2023
69bf65a
💚 [Debug] Display npm version in npm-scripts
sounisi5011 Mar 11, 2023
20e7387
💚 [Debug] Try `npm install --global ...` command instead of `npm-wind…
sounisi5011 Mar 11, 2023
4af9386
⏪ Revert "💚 [Debug] Display npm version in npm-scripts"
sounisi5011 Mar 11, 2023
fb0ba0b
💚 [Debug] Display npm versions in various Node.js
sounisi5011 Mar 11, 2023
daeadc6
💚 [Debug] Strictly check the npm version
sounisi5011 Mar 11, 2023
35fd4c7
⏪ Revert "💚 [Debug] Try `npm install --global ...` command instead of…
sounisi5011 Mar 11, 2023
285f2bc
💚 [Debug] Try to update npm with `npm install --global ...` command i…
sounisi5011 Mar 11, 2023
15e3d2c
⏪ Revert "💚 [Debug] Try to update npm with `npm install --global ...`…
sounisi5011 Mar 11, 2023
d9e76dd
💚 On Windows, use the `npx npm-windows-upgrade` command instead of th…
sounisi5011 Mar 11, 2023
f7af188
💚 [Debug] Try to overwrite npm without Corepack
sounisi5011 Mar 11, 2023
f99858f
⏪ Revert "💚 [Debug] Try to overwrite npm without Corepack"
sounisi5011 Mar 11, 2023
541f0c4
⏪ Revert "💚 [Debug] Display npm versions in various Node.js" and "💚 […
sounisi5011 Mar 11, 2023
4d93b85
⬆️ Update dependency can-npm-publish to 1.3.6
sounisi5011 Mar 12, 2023
01f868b
⬆️ Update dependency del-cli to 5.0.0
sounisi5011 Mar 12, 2023
cf6995d
⬆️ Update dependency escape-string-regexp to 4.0.0
sounisi5011 Mar 12, 2023
32e2a91
⬆️ Update dependency patch-package to 6.5.1
sounisi5011 Mar 12, 2023
69cf287
⬆️ Update dependency git-branch-is to 4.0.0
sounisi5011 Mar 12, 2023
706583d
⬆️ Update dependency prettier to 2.8.4
sounisi5011 Mar 12, 2023
42576ab
⬆️ Update dependency prettier-package-json to 2.8.0
sounisi5011 Mar 12, 2023
97b3c11
⬆️ Update dependency sort-package-json to 2.4.1
sounisi5011 Mar 12, 2023
83d6a40
⬆️ Update dependency eslint to 8.36.0
sounisi5011 Mar 12, 2023
3534049
📝 Update CHANGELOG
sounisi5011 Mar 12, 2023
293ffe8
🔧 Fix dependency version range: Use SemVer range for "cac" package ve…
sounisi5011 Mar 12, 2023
48bb3f4
🔧 Regenerate package-lock.json
sounisi5011 Mar 12, 2023
c5afb63
⬆️ Update dependency escape-string-regexp to 5.0.0
sounisi5011 Mar 12, 2023
6e1e500
⬇️ Downgrade dependency escape-string-regexp to 4.0.0
sounisi5011 Mar 12, 2023
d6252ba
⬆️ Update dependency execa to 7.1.0
sounisi5011 Mar 12, 2023
5122337
⬇️ Downgrade dependency execa to 5.1.1
sounisi5011 Mar 12, 2023
a92cf3c
⬆️ Update dependency ava to 5.2.0
sounisi5011 Mar 12, 2023
de12555
⬇️ Downgrade dependency ava to 4.3.3
sounisi5011 Mar 12, 2023
3f61b7e
⬇️ Downgrade dependency ava to 3.15.0
sounisi5011 Mar 12, 2023
16f9f7b
🚚 Rename `ava.config.js` file to `ava.config.cjs`
sounisi5011 Mar 12, 2023
4e37973
📝 Update CHANGELOG
sounisi5011 Mar 12, 2023
7abd09e
🔧 Modify `lefthook.yml` file
sounisi5011 Mar 12, 2023
648efc8
📝 Update CHANGELOG
sounisi5011 Mar 12, 2023
436b28d
✅ Reduce differences in test code from branch `master`
sounisi5011 Mar 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ rules:
- test/**
prettier/prettier: error
overrides:
- files: "*.js"
- files: "*.{js,cjs,mjs}"
extends:
- plugin:prettier/recommended
- files: "*.ts"
extends:
- plugin:@typescript-eslint/recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
- plugin:@typescript-eslint/strict
- plugin:import/typescript
- plugin:prettier/recommended
- prettier/@typescript-eslint
parser: "@typescript-eslint/parser"
parserOptions:
sourceType: module
Expand All @@ -40,7 +40,7 @@ overrides:
no-dupe-class-members: off
# The no-unused-expressions rule does not support optional chaining operator (`?.`)
no-unused-expressions: off
node/no-unsupported-features/es-syntax:
n/no-unsupported-features/es-syntax:
- error
- ignores:
- modules
Expand All @@ -56,7 +56,7 @@ overrides:
- allowShortCircuit: true
allowTernary: true
allowTaggedTemplates: true
simple-import-sort/sort: error
simple-import-sort/imports: error
- files: "*.d.ts"
rules:
no-redeclare: off
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,26 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Reconfigure git to use HTTP authentication
# see https://stackoverflow.com/a/69634516
# see https://github.com/actions/setup-node/issues/214#issuecomment-810829250
shell: bash
run: |
git config --global \
'url.https://${{ secrets.GITHUB_TOKEN }}@github.com/.insteadOf' \
'ssh://git@github.com/'

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: npm

- name: Enable Corepack (Automatically setup a package manager for Node.js)
run: |
corepack enable
corepack enable npm

- name: Show node and npm version
shell: bash
run: |
Expand All @@ -99,12 +113,78 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Reconfigure git to use HTTP authentication
# see https://stackoverflow.com/a/69634516
# see https://github.com/actions/setup-node/issues/214#issuecomment-810829250
shell: bash
run: |
git config --global \
'url.https://${{ secrets.GITHUB_TOKEN }}@github.com/.insteadOf' \
'ssh://git@github.com/'

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Enable Corepack (Automatically setup a package manager for Node.js)
shell: bash
run: |
if type corepack >/dev/null 2>&1; then
echo '::group::$' corepack enable
corepack enable
echo '::endgroup::'

echo '::group::$' corepack enable npm
corepack enable npm
echo '::endgroup::'
fi

# If Corepack is not available, manually update npm
# Note: I have tried to enable Corepack, but could not use Corepack in older Node.js or Windows environments.
# You can see what I did here: https://github.com/sounisi5011/package-version-git-tag/compare/24791b6ddab5cd2b8fdc735855556640746cc863~1...349c11acb35cfc0096bc6e9324bd9748e429ca17~1
packageManager="$(< "${GITHUB_WORKSPACE}/package.json" jq --raw-output '.packageManager')"
if [[ "${packageManager}" == 'npm@'* && "npm@$(npm --version)" != "${packageManager%%+*}" ]]; then
# Disable the built-in Corepack in GitHub Actions.
# If enabled, problems will occur when the yarn command is executed.
if type corepack >/dev/null 2>&1; then
echo '::group::$' corepack disable
corepack disable
echo '::endgroup::'
fi

readonly npmSemver="${packageManager##npm@}"
echo "required-npm-version=${npmSemver%%+*}" >> "${GITHUB_ENV}"
fi

# If yarn is not available, install it
if type yarn >/dev/null 2>&1; then
:
else
echo '::group::' Install yarn
npm install --global --force 'yarn@1.x'
echo '::endgroup::'
fi

- name: Update to the specified npm (Using "npx npm-windows-upgrade")
if: ${{ env.required-npm-version && runner.os == 'Windows' }}
# On Windows, the "npm install --global npm" command does not properly overwrite npm.
# Instead of the "npm install --global npm" command, "npx npm-windows-upgrade" can be used to correctly overwrite npm.
# see https://stackoverflow.com/a/31520672
# Note: The referenced answer says that the "npm install --global npm" command is available for Node.js v16 or later.
# However, when I tried, this problem occurred in all versions of Node.js v14 or later.
shell: pwsh
run: |
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npx npm-windows-upgrade --npm-version '${{ env.required-npm-version }}'
# see https://github.com/orgs/community/discussions/26641
echo 'required-npm-version=' >> $Env:GITHUB_ENV

- name: Update to the specified npm (Using "npm install --global npm")
if: ${{ env.required-npm-version }}
run: npm install --global --force 'npm@${{ env.required-npm-version }}'

- name: Show node and npm version
shell: bash
run: |
Expand Down
2 changes: 0 additions & 2 deletions .huskyrc.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .lintstagedrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
overrides:
- files: "*.js"
- files: "*.{js,cjs,mjs}"
options:
singleQuote: true
trailingComma: all
Expand Down
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,85 @@ This project will support Node.js 14.0.0 or later from now on.

### Updated Dependencies

#### dependencies

* `cac`
* [#185] - `^6.5.8` -> `6.5.8 - 6.6.x`

The format of help messages has changed since cac 6.7.0.
see https://github.com/cacjs/cac/commit/e565b2ae5d4a3256ed4d56a64d91356e7d6cbce6

#### devDependencies

* `@types/node`
* [#186] - `12.x` -> `14.x`
* `@typescript-eslint/eslint-plugin`
* [#185] - `2.34.0` -> `5.54.1`
* `@typescript-eslint/parser`
* [#185] - `2.34.0` -> `5.54.1`
* `ava`
* [#185] - `2.4.0` -> `3.15.0`

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.
* `can-npm-publish`
* [#185] - `1.3.2` -> `1.3.6`
* `del-cli`
* [#185] - `3.0.1` -> `5.0.0`
* `escape-string-regexp`
* [#185] - `2.0.0` -> `4.0.0`

We will not update to v5 because we cannot yet use ESM for unit testing on this project.
* `eslint`
* [#185] - `6.8.0` -> `8.36.0`
* `eslint-config-prettier`
* [#185] - `6.11.0` -> `8.7.0`
* `eslint-config-standard`
* [#185] - `14.1.1` -> `17.0.0`
* `eslint-plugin-import`
* [#185] - `2.20.2` -> `2.27.5`
* `eslint-plugin-prettier`
* [#185] - `3.1.3` -> `4.2.1`
* `eslint-plugin-promise`
* [#185] - `4.2.1` -> `6.1.1`
* `eslint-plugin-simple-import-sort`
* [#185] - `5.0.3` -> `10.0.0`
* `git-branch-is`
* [#185] - `3.1.0` -> `4.0.0`
* `node-git-server`
* [#185] - `0.6.1` -> `1.0.0`
* `patch-package`
* [#185] - `6.2.2` -> `6.5.1`
* `prettier`
* [#185] - `2.0.5` -> `2.8.4`
* `prettier-package-json`
* [#185] - `2.1.3` -> `2.8.0`
* `sort-package-json`
* [#185] - `1.44.0` -> `2.4.1`
* `ts-node`
* [#185] - `8.10.2` -> `10.9.1`
* `typescript`
* [#185] - `3.9.3` -> `4.9.5`

### Added Dependencies

#### devDependencies

* [#186] - `@tsconfig/node14@1.0.3`
* [#185] - `eslint-plugin-n@15.6.1`
* [#185] - `execa@5.1.1`

We will not use v6 or later because the ESM cannot yet be used for unit testing in this project.
* [#185] - `lefthook@1.3.3`

### Removed Dependencies

#### devDependencies

* [#186] - `del`
* [#185] - `eslint-plugin-node`
* [#185] - `eslint-plugin-standard`
* [#185] - `husky`
* [#185] - `lint-staged`
* [#186] - `make-dir`

### Others
Expand All @@ -48,6 +111,7 @@ This project will support Node.js 14.0.0 or later from now on.
[#183]: https://github.com/sounisi5011/package-version-git-tag/pull/183
[#186]: https://github.com/sounisi5011/package-version-git-tag/pull/186
[#187]: https://github.com/sounisi5011/package-version-git-tag/pull/187
[#185]: https://github.com/sounisi5011/package-version-git-tag/pull/185

## [3.0.0] (2020-06-02 UTC)

Expand Down
6 changes: 6 additions & 0 deletions ava.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extensions: ['ts'],
files: ['./test/**/*.ts', '!**/helpers/**/*'],
require: ['ts-node/register/transpile-only'],
timeout: '5m',
};
7 changes: 0 additions & 7 deletions ava.config.js

This file was deleted.

70 changes: 70 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
pre-commit:
piped: true

# Always prints the output of each command.
# This allows the error log to be checked even if the command becomes busy.
follow: true

commands:
0_test-readme:
# If "{REPO_ROOT}/README.md" is staged, test it
# Note: README.md files in subdirectories are not included
files: git diff --name-only --cached | grep -Fx README.md || true
run: npm run test:readme
1_format:
# Call the "lefthook run ..." command within lefthook to perform parallel execution in the middle of a serial execution
# see https://github.com/evilmartians/lefthook/issues/66#issuecomment-1313279972
env:
LEFTHOOK_QUIET: meta,summary,success
run: npx lefthook run _pre-commit__format
2_build-readme:
# If any file other than "{REPO_ROOT}/README.md" is staged, build README.md
# Note: README.md files in subdirectories are included
files: git diff --name-only --cached | grep -Fvx README.md || true
run: >-
npm run build:readme
&& git add ./README.md

_pre-commit__format:
parallel: true
commands:
format/config:
env:
LEFTHOOK_QUIET: meta,summary,success
run: lefthook run _pre-commit__format__config
format/ts&js:
env:
LEFTHOOK_QUIET: meta,summary,success
run: lefthook run '_pre-commit__format__ts&js'

_pre-commit__format__config:
piped: true
commands:
format/config/0_prettier:
glob: "*.{json,yaml,yml}"
run: >-
npx prettier --write {staged_files}
&& git add {staged_files}
format/config/1_format-package-json:
# Note: If "package.json" is specified, only the root package.json file will be included.
# If "**/package.json" is specified, only package.json files in subdirectories will be included.
# To include both, it appears that the "{,**/}package.json" pattern should be used.
glob: "{,**/}package.json"
run: >-
npx prettier-package-json --write {staged_files}
&& npx sort-package-json {staged_files}
&& git add {staged_files}

_pre-commit__format__ts&js:
piped: true
commands:
format/ts&js/0_prettier:
glob: "*.{ts,js,cjs,mjs}"
run: >-
npx prettier --write {staged_files}
&& git add {staged_files}
format/ts&js/1_eslint:
glob: "*.{ts,js,cjs,mjs}"
run: >-
npx eslint --fix {staged_files}
&& git add {staged_files}
Loading