From ea1ab9cc8048a2b715473c878641d1e189daaf1c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:05:50 +0800 Subject: [PATCH 1/8] fix: update dependency inquirer to v9.2.16 (#3972) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 80 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 71 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index c6ef3b1a9f..3be74c412b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1314,12 +1314,12 @@ npmlog "^6.0.2" write-file-atomic "^4.0.1" -"@ljharb/through@^2.3.12": - version "2.3.12" - resolved "https://registry.npmjs.org/@ljharb/through/-/through-2.3.12.tgz#c418c43060eee193adce48b15c2206096a28e9ea" - integrity sha512-ajo/heTlG3QgC8EGP6APIejksVAYt4ayz4tqoP3MolFELzcH1x1fzwEYRJTPO0IELutZ5HQ0c26/GqAYy79u3g== +"@ljharb/through@^2.3.13": + version "2.3.13" + resolved "https://registry.npmjs.org/@ljharb/through/-/through-2.3.13.tgz#b7e4766e0b65aa82e529be945ab078de79874edc" + integrity sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ== dependencies: - call-bind "^1.0.5" + call-bind "^1.0.7" "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -2972,6 +2972,17 @@ call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.4, call-bind@^1.0.5: get-intrinsic "^1.2.1" set-function-length "^1.1.1" +call-bind@^1.0.7: + version "1.0.7" + resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" + integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + set-function-length "^1.2.1" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -3531,6 +3542,15 @@ define-data-property@^1.0.1, define-data-property@^1.1.1: gopd "^1.0.1" has-property-descriptors "^1.0.0" +define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz" @@ -3763,6 +3783,18 @@ es-abstract@^1.22.1: unbox-primitive "^1.0.2" which-typed-array "^1.1.13" +es-define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" + integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== + dependencies: + get-intrinsic "^1.2.4" + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + es-set-tostringtag@^2.0.1: version "2.0.2" resolved "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz" @@ -4366,6 +4398,17 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@ has-symbols "^1.0.3" hasown "^2.0.0" +get-intrinsic@^1.2.4: + version "1.2.4" + resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" + integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + get-pkg-repo@^4.0.0: version "4.2.1" resolved "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-4.2.1.tgz" @@ -4631,6 +4674,13 @@ has-property-descriptors@^1.0.0: dependencies: get-intrinsic "^1.2.2" +has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + has-proto@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz" @@ -4894,11 +4944,11 @@ inquirer@8.2.5, inquirer@^8.2.4: wrap-ansi "^7.0.0" inquirer@^9.2.15: - version "9.2.15" - resolved "https://registry.npmjs.org/inquirer/-/inquirer-9.2.15.tgz#2135a36190a6e5c92f5d205e0af1fea36b9d3492" - integrity sha512-vI2w4zl/mDluHt9YEQ/543VTCwPKWiHzKtm9dM2V0NdFcqEexDAjUHzO1oA60HRNaVifGXXM1tRRNluLVHa0Kg== + version "9.2.16" + resolved "https://registry.npmjs.org/inquirer/-/inquirer-9.2.16.tgz#9291fbfdf96fd793179c9575f76fa50a5ed27349" + integrity sha512-qzgbB+yNjgSzk2omeqMDtO9IgJet/UL67luT1MaaggRpGK73DBQct5Q4pipwFQcIKK1GbMODYd4UfsRCkSP1DA== dependencies: - "@ljharb/through" "^2.3.12" + "@ljharb/through" "^2.3.13" ansi-escapes "^4.3.2" chalk "^5.3.0" cli-cursor "^3.1.0" @@ -7275,6 +7325,18 @@ set-function-length@^1.1.1: gopd "^1.0.1" has-property-descriptors "^1.0.0" +set-function-length@^1.2.1: + version "1.2.2" + resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + set-function-name@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz" From 391e8ca49f1bb295b6bf12394e56239780c7f1d4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:15:28 +0800 Subject: [PATCH 2/8] chore: update dependency @swc/core to v1.4.7 (#3973) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 124 +++++++++++++++++++++++++++--------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3be74c412b..595c0c920f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1785,74 +1785,74 @@ dependencies: "@sinonjs/commons" "^3.0.0" -"@swc/core-darwin-arm64@1.4.6": - version "1.4.6" - resolved "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.4.6.tgz#4465c6f1ae011d4829ba8923f6aac9aae7828416" - integrity sha512-bpggpx/BfLFyy48aUKq1PsNUxb7J6CINlpAUk0V4yXfmGnpZH80Gp1pM3GkFDQyCfq7L7IpjPrIjWQwCrL4hYw== - -"@swc/core-darwin-x64@1.4.6": - version "1.4.6" - resolved "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.4.6.tgz#5ddda080ad9824b56d6470163c752e27e22d5a89" - integrity sha512-vJn+/ZuBTg+vtNkcmgZdH6FQpa0hFVdnB9bAeqYwKkyqP15zaPe6jfC+qL2y/cIeC7ASvHXEKrnCZgBLxfVQ9w== - -"@swc/core-linux-arm-gnueabihf@1.4.6": - version "1.4.6" - resolved "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.4.6.tgz#eb6dbd10bd4b6ad36f85ef9c99c675f1aa4f598b" - integrity sha512-hEmYcB/9XBAl02MtuVHszhNjQpjBzhk/NFulnU33tBMbNZpy2TN5yTsitezMq090QXdDz8sKIALApDyg07ZR8g== - -"@swc/core-linux-arm64-gnu@1.4.6": - version "1.4.6" - resolved "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.4.6.tgz#41ce65332b2e8d5bf69b0e95fd02a9134784d5de" - integrity sha512-/UCYIVoGpm2YVvGHZM2QOA3dexa28BjcpLAIYnoCbgH5f7ulDhE8FAIO/9pasj+kixDBsdqewHfsNXFYlgGJjQ== - -"@swc/core-linux-arm64-musl@1.4.6": - version "1.4.6" - resolved "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.4.6.tgz#0d579abd7960db3f08915beac0f3bac3cd202425" - integrity sha512-LGQsKJ8MA9zZ8xHCkbGkcPSmpkZL2O7drvwsGKynyCttHhpwVjj9lguhD4DWU3+FWIsjvho5Vu0Ggei8OYi/Lw== - -"@swc/core-linux-x64-gnu@1.4.6": - version "1.4.6" - resolved "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.4.6.tgz#204d4a722ae8e9d4800d37583b64ef6472f6ad74" - integrity sha512-10JL2nLIreMQDKvq2TECnQe5fCuoqBHu1yW8aChqgHUyg9d7gfZX/kppUsuimqcgRBnS0AjTDAA+JF6UsG/2Yg== - -"@swc/core-linux-x64-musl@1.4.6": - version "1.4.6" - resolved "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.4.6.tgz#d2d1b1130a275a428ff144fedaffb75db8081022" - integrity sha512-EGyjFVzVY6Do89x8sfah7I3cuP4MwtwzmA6OlfD/KASqfCFf5eIaEBMbajgR41bVfMV7lK72lwAIea5xEyq1AQ== - -"@swc/core-win32-arm64-msvc@1.4.6": - version "1.4.6" - resolved "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.4.6.tgz#86066f9eee4e73b24826184f930eb3fb44e2b973" - integrity sha512-gfW9AuXvwSyK07Vb8Y8E9m2oJZk21WqcD+X4BZhkbKB0TCZK0zk1j/HpS2UFlr1JB2zPKPpSWLU3ll0GEHRG2A== - -"@swc/core-win32-ia32-msvc@1.4.6": - version "1.4.6" - resolved "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.4.6.tgz#238b5143b9fec2048cf0a0e24763775561a472b1" - integrity sha512-ZuQm81FhhvNVYtVb9GfZ+Du6e7fZlkisWvuCeBeRiyseNt1tcrQ8J3V67jD2nxje8CVXrwG3oUIbPcybv2rxfQ== - -"@swc/core-win32-x64-msvc@1.4.6": - version "1.4.6" - resolved "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.4.6.tgz#36f8fbe6ec04c5b39c34ad41bb6803ba9a306da7" - integrity sha512-UagPb7w5V0uzWSjrXwOavGa7s9iv3wrVdEgWy+/inm0OwY4lj3zpK9qDnMWAwYLuFwkI3UG4Q3dH8wD+CUUcjw== +"@swc/core-darwin-arm64@1.4.7": + version "1.4.7" + resolved "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.4.7.tgz#158c7d1a5d1aa0d1e57f24f7a58fa23389d4b666" + integrity sha512-IhfP2Mrrh9WcdlBJQbPNBhfdOhW/SC910SiuzvxaLgJmzq1tw6TVDNUz4Zf85TbK5uzgR0emtPc9hTGxynl57A== + +"@swc/core-darwin-x64@1.4.7": + version "1.4.7" + resolved "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.4.7.tgz#4a7a9a935d1a23402d45a1602026e4f677983776" + integrity sha512-MO01pnxJDS6st5IiqyTnAOz9kpAPP/O4lzEUH9E80XdXBzwptS5hNTM0egBlqueWDFrPM26RI81JLtyTU7kR8w== + +"@swc/core-linux-arm-gnueabihf@1.4.7": + version "1.4.7" + resolved "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.4.7.tgz#54f80af37fae84676d50f729312bd5ff384a8c42" + integrity sha512-+cDaXW6PZqGhXIq9C4xE+/QuyUsLkXf8d8uSXep+rZYDl4YHS9Fi7HpZQnqLX6al/iVhwe3VnxHMGw50gxcr/g== + +"@swc/core-linux-arm64-gnu@1.4.7": + version "1.4.7" + resolved "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.4.7.tgz#0f0a47b6e6d2d5404c755a73ba52a71240763500" + integrity sha512-RNnVHRKhEtA3pM34wgb3Vumf5M6/XlWzFdkHEMZIkOKyNSUhZiv8X3tsEK+n1rZQWIDkvlw4YyHtB8vK18WdCA== + +"@swc/core-linux-arm64-musl@1.4.7": + version "1.4.7" + resolved "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.4.7.tgz#baafa993ae121f43162a00fdb774b8456c0079bc" + integrity sha512-p7Xm4Pib02d1SFS9XXMoOcCTDIkFWMspspptPX00VcjAdZYnXWujWGuD2W+KN1gq5syHB1g3TsYs9LP2dGsKqw== + +"@swc/core-linux-x64-gnu@1.4.7": + version "1.4.7" + resolved "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.4.7.tgz#88cfbc497c997aff209b57115d9cbaf597393ff9" + integrity sha512-ViI5jy03cFYPETsye1J+oPbHE4v8oIDN34qebzvgHUlNKOXfc1ig0Zha5oQnKp3zj1rmjcSLIMqK++WR021G5A== + +"@swc/core-linux-x64-musl@1.4.7": + version "1.4.7" + resolved "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.4.7.tgz#12f6277d3f7167a698a5c87d0796dd810f8eb273" + integrity sha512-Nf3Axcx/ILl7XE44eidNNPF39rg/KIeqg2545vrOXJG02iu7pEjZuu8wm6w+23BpP4COjZJymlg9LzPT1ZBD5Q== + +"@swc/core-win32-arm64-msvc@1.4.7": + version "1.4.7" + resolved "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.4.7.tgz#591ea5067d3ee0d1f45b313dde2b8d8fb6be5eb2" + integrity sha512-MFkJEaC59AO2HpndmHhCkaj8NJus5etjMtBphOe9em7jmmfdQ7mLenKHbZ/CspHNl8yNPO9Qzpa/at2838x+RQ== + +"@swc/core-win32-ia32-msvc@1.4.7": + version "1.4.7" + resolved "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.4.7.tgz#bc603df8aff3a21d4f9f2b834e751d3ec1bf45ef" + integrity sha512-nwrfERocUei9sxqd6URrWcEC3KDcTBD+beMerB9idvuzy4rcm5k1O1ClUlZ9pJOZn+vMN1tqZjLze4hJMT9STQ== + +"@swc/core-win32-x64-msvc@1.4.7": + version "1.4.7" + resolved "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.4.7.tgz#b4683ad864591e127f865fd1fbca2cfbae9e672a" + integrity sha512-d5T8Z/axAml8FTA+T9RS2mwJDNIbSSz5jcEiWaGuKVDIoSZib2HpMvnMydOGsIrmjfS1Z4ZhdAawivPhAZ3M8Q== "@swc/core@^1.4.2": - version "1.4.6" - resolved "https://registry.npmjs.org/@swc/core/-/core-1.4.6.tgz#d2bceb1296aaf0fa6fbd85eb6f8d797fe5cd8d8c" - integrity sha512-A7iK9+1qzTCIuc3IYcS8gPHCm9bZVKUJrfNnwveZYyo6OFp3jLno4WOM2yBy5uqedgYATEiWgBYHKq37KrU6IA== + version "1.4.7" + resolved "https://registry.npmjs.org/@swc/core/-/core-1.4.7.tgz#94ac45187fa2fdbd6cbb34dbda089c174ec64c1d" + integrity sha512-I7a9sUxB+z+UCf6KudqrQH/RgLal/S+E+t4uBdbggycLyJe7WvBgPrQlcN5UpEuD9YC2PJ0CN6kgD6ARStg+pg== dependencies: "@swc/counter" "^0.1.2" "@swc/types" "^0.1.5" optionalDependencies: - "@swc/core-darwin-arm64" "1.4.6" - "@swc/core-darwin-x64" "1.4.6" - "@swc/core-linux-arm-gnueabihf" "1.4.6" - "@swc/core-linux-arm64-gnu" "1.4.6" - "@swc/core-linux-arm64-musl" "1.4.6" - "@swc/core-linux-x64-gnu" "1.4.6" - "@swc/core-linux-x64-musl" "1.4.6" - "@swc/core-win32-arm64-msvc" "1.4.6" - "@swc/core-win32-ia32-msvc" "1.4.6" - "@swc/core-win32-x64-msvc" "1.4.6" + "@swc/core-darwin-arm64" "1.4.7" + "@swc/core-darwin-x64" "1.4.7" + "@swc/core-linux-arm-gnueabihf" "1.4.7" + "@swc/core-linux-arm64-gnu" "1.4.7" + "@swc/core-linux-arm64-musl" "1.4.7" + "@swc/core-linux-x64-gnu" "1.4.7" + "@swc/core-linux-x64-musl" "1.4.7" + "@swc/core-win32-arm64-msvc" "1.4.7" + "@swc/core-win32-ia32-msvc" "1.4.7" + "@swc/core-win32-x64-msvc" "1.4.7" "@swc/counter@^0.1.2": version "0.1.3" From 99f4f3f4839190a2758083df7ba20b988e7b68a6 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Thu, 14 Mar 2024 09:16:50 +0800 Subject: [PATCH 3/8] feat(cli): introduce new --last flag, to stop recommending HEAD~1 (#3916) * test(cli): add regression test * feat(cli): implement new `--last` CLI flag The upgrade of ES2017 to ES2022 is because of the use of `Object.hasOwn` API which is less ugly than hardcoding `undefined`. * docs(ci): stop recommending HEAD~1 In a single-commit repo, this would lead to this error: ``` Error: fatal: ambiguous argument 'HEAD~1..HEAD': unknown revision or path not in the working tree. ``` Now that we have the `--last` flag, this should work for the case in which we want just to analyze the last commit, not specify a range of commits via `--from` and `--to`. Closes https://github.com/conventional-changelog/commitlint/pull/3892 * fix: use --pretty=format:"%B" instead of --pretty=%B The latter adds unnecessary whitespace at the end of the commit msg. --------- Co-authored-by: Mehrshad --- @commitlint/cli/src/cli.test.ts | 11 +++++++++++ @commitlint/cli/src/cli.ts | 27 +++++++++++++++++++++++++-- @commitlint/cli/src/types.ts | 1 + @commitlint/read/package.json | 6 +++--- @commitlint/read/src/read.ts | 14 +++++++++++++- docs/guides/ci-setup.md | 2 +- tsconfig.shared.json | 4 ++-- 7 files changed, 56 insertions(+), 9 deletions(-) diff --git a/@commitlint/cli/src/cli.test.ts b/@commitlint/cli/src/cli.test.ts index 846869d5e8..b7b83ea401 100644 --- a/@commitlint/cli/src/cli.test.ts +++ b/@commitlint/cli/src/cli.test.ts @@ -52,6 +52,16 @@ test('should produce success output with --verbose flag', async () => { expect(actual.stderr).toEqual(''); }); +test('should produce last commit and success output with --verbose flag', async () => { + const cwd = await gitBootstrap('fixtures/simple'); + await execa('git', ['add', 'commitlint.config.js'], {cwd}); + await execa('git', ['commit', '-m', '"test: this should work"'], {cwd}); + const actual = await cli(['--last', '--verbose'], {cwd})(); + expect(actual.stdout).toContain('0 problems, 0 warnings'); + expect(actual.stdout).toContain('test: this should work'); + expect(actual.stderr).toEqual(''); +}); + test('should produce no output with --quiet flag', async () => { const cwd = await gitBootstrap('fixtures/default'); const actual = await cli(['--quiet'], {cwd})('foo: bar'); @@ -529,6 +539,7 @@ test('should print help', async () => { -H, --help-url help url in error message [string] -f, --from lower end of the commit range to lint; applies if edit=false [string] --git-log-args additional git log arguments as space separated string, example '--first-parent --cherry-pick' [string] + -l, --last just analyze the last commit; applies if edit=false [boolean] -o, --format output format of the results [string] -p, --parser-preset configuration preset to use for conventional-commits-parser [string] -q, --quiet toggle console output [boolean] [default: false] diff --git a/@commitlint/cli/src/cli.ts b/@commitlint/cli/src/cli.ts index b871d2fa56..b58c047be1 100644 --- a/@commitlint/cli/src/cli.ts +++ b/@commitlint/cli/src/cli.ts @@ -95,6 +95,11 @@ const cli = yargs(process.argv.slice(2)) "additional git log arguments as space separated string, example '--first-parent --cherry-pick'", type: 'string', }, + last: { + alias: 'l', + description: 'just analyze the last commit; applies if edit=false', + type: 'boolean', + }, format: { alias: 'o', description: 'output format of the results', @@ -214,11 +219,25 @@ async function main(args: MainArgs): Promise { const fromStdin = checkFromStdin(raw, flags); + if ( + Object.hasOwn(flags, 'last') && + (Object.hasOwn(flags, 'from') || Object.hasOwn(flags, 'to') || flags.edit) + ) { + const err = new CliError( + 'Please use the --last flag alone. The --last flag should not be used with --to or --from or --edit.', + pkg.name + ); + cli.showHelp('log'); + console.log(err.message); + throw err; + } + const input = await (fromStdin ? stdin() : read({ to: flags.to, from: flags.from, + last: flags.last, edit: flags.edit, cwd: flags.cwd, gitLogArgs: flags['git-log-args'], @@ -231,7 +250,7 @@ async function main(args: MainArgs): Promise { if (messages.length === 0 && !checkFromRepository(flags)) { const err = new CliError( - '[input] is required: supply via stdin, or --env or --edit or --from and --to', + '[input] is required: supply via stdin, or --env or --edit or --last or --from and --to', pkg.name ); cli.showHelp('log'); @@ -374,7 +393,11 @@ function checkFromEdit(flags: CliFlags): boolean { } function checkFromHistory(flags: CliFlags): boolean { - return typeof flags.from === 'string' || typeof flags.to === 'string'; + return ( + typeof flags.from === 'string' || + typeof flags.to === 'string' || + typeof flags.last === 'boolean' + ); } function normalizeFlags(flags: CliFlags): CliFlags { diff --git a/@commitlint/cli/src/types.ts b/@commitlint/cli/src/types.ts index a622cb05fe..42056cc556 100644 --- a/@commitlint/cli/src/types.ts +++ b/@commitlint/cli/src/types.ts @@ -9,6 +9,7 @@ export interface CliFlags { 'help-url'?: string; from?: string; 'git-log-args'?: string; + last?: boolean; format?: string; 'parser-preset'?: string; quiet: boolean; diff --git a/@commitlint/read/package.json b/@commitlint/read/package.json index 1ea5ebe666..59e8fbed5d 100644 --- a/@commitlint/read/package.json +++ b/@commitlint/read/package.json @@ -39,14 +39,14 @@ "@commitlint/test": "^19.0.0", "@commitlint/utils": "^19.0.0", "@types/git-raw-commits": "^2.0.3", - "@types/minimist": "^1.2.4", - "execa": "^8.0.1" + "@types/minimist": "^1.2.4" }, "dependencies": { "@commitlint/top-level": "^19.0.0", "@commitlint/types": "^19.0.3", "git-raw-commits": "^4.0.0", - "minimist": "^1.2.8" + "minimist": "^1.2.8", + "execa": "^8.0.1" }, "gitHead": "70f7f4688b51774e7ac5e40e896cdaa3f132b2bc" } diff --git a/@commitlint/read/src/read.ts b/@commitlint/read/src/read.ts index a272cca394..d0ffdb9387 100644 --- a/@commitlint/read/src/read.ts +++ b/@commitlint/read/src/read.ts @@ -4,10 +4,13 @@ import type {GitOptions} from 'git-raw-commits'; import {getHistoryCommits} from './get-history-commits.js'; import {getEditCommit} from './get-edit-commit.js'; +import {execa} from 'execa'; + interface GetCommitMessageOptions { cwd?: string; from?: string; to?: string; + last?: boolean; edit?: boolean | string; gitLogArgs?: string; } @@ -16,12 +19,21 @@ interface GetCommitMessageOptions { export default async function getCommitMessages( settings: GetCommitMessageOptions ): Promise { - const {cwd, from, to, edit, gitLogArgs} = settings; + const {cwd, from, to, last, edit, gitLogArgs} = settings; if (edit) { return getEditCommit(cwd, edit); } + if (last) { + const executeGitCommand = await execa('git', [ + 'log', + '-1', + '--pretty=format:"%B"', + ]); + return [executeGitCommand.stdout]; + } + let gitOptions: GitOptions = {from, to}; if (gitLogArgs) { gitOptions = { diff --git a/docs/guides/ci-setup.md b/docs/guides/ci-setup.md index d4c217d373..1d3e37797b 100644 --- a/docs/guides/ci-setup.md +++ b/docs/guides/ci-setup.md @@ -42,7 +42,7 @@ jobs: - name: Validate current commit (last commit) with commitlint if: github.event_name == 'push' - run: npx commitlint --from HEAD~1 --to HEAD --verbose + run: npx commitlint --last --verbose - name: Validate PR commits with commitlint if: github.event_name == 'pull_request' diff --git a/tsconfig.shared.json b/tsconfig.shared.json index 9abe5b68fa..150d512559 100644 --- a/tsconfig.shared.json +++ b/tsconfig.shared.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "target": "ES2017", - "lib": ["es2017"], + "target": "ES2022", + "lib": ["es2022"], "declaration": true, "declarationMap": true, "sourceMap": true, From 207d2c0420104c8b4ccf1dee30c589c3e824535f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:23:41 +0800 Subject: [PATCH 4/8] chore: update dependency @types/node to v18.19.24 (#3974) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 595c0c920f..11b8266534 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2064,9 +2064,9 @@ undici-types "~5.26.4" "@types/node@^18.19.17": - version "18.19.23" - resolved "https://registry.npmjs.org/@types/node/-/node-18.19.23.tgz#e02c759218bc9957423a3f7d585d511b17be2351" - integrity sha512-wtE3d0OUfNKtZYAqZb8HAWGxxXsImJcPUAgZNw+dWFxO6s5tIwIjyKnY76tsTatsNCLJPkVYwUpq15D38ng9Aw== + version "18.19.24" + resolved "https://registry.npmjs.org/@types/node/-/node-18.19.24.tgz#707d8a4907e55901466e60e8f7a62bc6197ace95" + integrity sha512-eghAz3gnbQbvnHqB+mgB2ZR3aH6RhdEmHGS48BnV75KceQPHqabkxKI0BbUSsqhqy2Ddhc2xD/VAR9ySZd57Lw== dependencies: undici-types "~5.26.4" From 711588d7487625d06de37501ff75c4dcf31a9e80 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 10:13:33 +0800 Subject: [PATCH 5/8] chore: update dependency @swc/core to v1.4.8 (#3975) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 124 +++++++++++++++++++++++++++--------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/yarn.lock b/yarn.lock index 11b8266534..2b20022575 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1785,74 +1785,74 @@ dependencies: "@sinonjs/commons" "^3.0.0" -"@swc/core-darwin-arm64@1.4.7": - version "1.4.7" - resolved "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.4.7.tgz#158c7d1a5d1aa0d1e57f24f7a58fa23389d4b666" - integrity sha512-IhfP2Mrrh9WcdlBJQbPNBhfdOhW/SC910SiuzvxaLgJmzq1tw6TVDNUz4Zf85TbK5uzgR0emtPc9hTGxynl57A== - -"@swc/core-darwin-x64@1.4.7": - version "1.4.7" - resolved "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.4.7.tgz#4a7a9a935d1a23402d45a1602026e4f677983776" - integrity sha512-MO01pnxJDS6st5IiqyTnAOz9kpAPP/O4lzEUH9E80XdXBzwptS5hNTM0egBlqueWDFrPM26RI81JLtyTU7kR8w== - -"@swc/core-linux-arm-gnueabihf@1.4.7": - version "1.4.7" - resolved "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.4.7.tgz#54f80af37fae84676d50f729312bd5ff384a8c42" - integrity sha512-+cDaXW6PZqGhXIq9C4xE+/QuyUsLkXf8d8uSXep+rZYDl4YHS9Fi7HpZQnqLX6al/iVhwe3VnxHMGw50gxcr/g== - -"@swc/core-linux-arm64-gnu@1.4.7": - version "1.4.7" - resolved "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.4.7.tgz#0f0a47b6e6d2d5404c755a73ba52a71240763500" - integrity sha512-RNnVHRKhEtA3pM34wgb3Vumf5M6/XlWzFdkHEMZIkOKyNSUhZiv8X3tsEK+n1rZQWIDkvlw4YyHtB8vK18WdCA== - -"@swc/core-linux-arm64-musl@1.4.7": - version "1.4.7" - resolved "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.4.7.tgz#baafa993ae121f43162a00fdb774b8456c0079bc" - integrity sha512-p7Xm4Pib02d1SFS9XXMoOcCTDIkFWMspspptPX00VcjAdZYnXWujWGuD2W+KN1gq5syHB1g3TsYs9LP2dGsKqw== - -"@swc/core-linux-x64-gnu@1.4.7": - version "1.4.7" - resolved "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.4.7.tgz#88cfbc497c997aff209b57115d9cbaf597393ff9" - integrity sha512-ViI5jy03cFYPETsye1J+oPbHE4v8oIDN34qebzvgHUlNKOXfc1ig0Zha5oQnKp3zj1rmjcSLIMqK++WR021G5A== - -"@swc/core-linux-x64-musl@1.4.7": - version "1.4.7" - resolved "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.4.7.tgz#12f6277d3f7167a698a5c87d0796dd810f8eb273" - integrity sha512-Nf3Axcx/ILl7XE44eidNNPF39rg/KIeqg2545vrOXJG02iu7pEjZuu8wm6w+23BpP4COjZJymlg9LzPT1ZBD5Q== - -"@swc/core-win32-arm64-msvc@1.4.7": - version "1.4.7" - resolved "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.4.7.tgz#591ea5067d3ee0d1f45b313dde2b8d8fb6be5eb2" - integrity sha512-MFkJEaC59AO2HpndmHhCkaj8NJus5etjMtBphOe9em7jmmfdQ7mLenKHbZ/CspHNl8yNPO9Qzpa/at2838x+RQ== - -"@swc/core-win32-ia32-msvc@1.4.7": - version "1.4.7" - resolved "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.4.7.tgz#bc603df8aff3a21d4f9f2b834e751d3ec1bf45ef" - integrity sha512-nwrfERocUei9sxqd6URrWcEC3KDcTBD+beMerB9idvuzy4rcm5k1O1ClUlZ9pJOZn+vMN1tqZjLze4hJMT9STQ== - -"@swc/core-win32-x64-msvc@1.4.7": - version "1.4.7" - resolved "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.4.7.tgz#b4683ad864591e127f865fd1fbca2cfbae9e672a" - integrity sha512-d5T8Z/axAml8FTA+T9RS2mwJDNIbSSz5jcEiWaGuKVDIoSZib2HpMvnMydOGsIrmjfS1Z4ZhdAawivPhAZ3M8Q== +"@swc/core-darwin-arm64@1.4.8": + version "1.4.8" + resolved "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.4.8.tgz#2fb702e209310c2da2bc712b0757c011b583a60d" + integrity sha512-hhQCffRTgzpTIbngSnC30vV6IJVTI9FFBF954WEsshsecVoCGFiMwazBbrkLG+RwXENTrMhgeREEFh6R3KRgKQ== + +"@swc/core-darwin-x64@1.4.8": + version "1.4.8" + resolved "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.4.8.tgz#a5bcbec6830800ca8acafbda1944464ca8421804" + integrity sha512-P3ZBw8Jr8rKhY/J8d+6WqWriqngGTgHwtFeJ8MIakQJTbdYbFgXSZxcvDiERg3psbGeFXaUaPI0GO6BXv9k/OQ== + +"@swc/core-linux-arm-gnueabihf@1.4.8": + version "1.4.8" + resolved "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.4.8.tgz#0bf6ae3793bbb7dd0e47c3d153350d31b7e63cf9" + integrity sha512-PP9JIJt19bUWhAGcQW6qMwTjZOcMyzkvZa0/LWSlDm0ORYVLmDXUoeQbGD3e0Zju9UiZxyulnpjEN0ZihJgPTA== + +"@swc/core-linux-arm64-gnu@1.4.8": + version "1.4.8" + resolved "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.4.8.tgz#8d3d3e698fc243d4a55c01a968b7297547aa6275" + integrity sha512-HvEWnwKHkoVUr5iftWirTApFJ13hGzhAY2CMw4lz9lur2m+zhPviRRED0FCI6T95Knpv7+8eUOr98Z7ctrG6DQ== + +"@swc/core-linux-arm64-musl@1.4.8": + version "1.4.8" + resolved "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.4.8.tgz#ace70bbb650ceb70609987c5b07ff34462960b9e" + integrity sha512-kY8+qa7k/dEeBq9p0Hrta18QnJPpsiJvDQSLNaTIFpdM3aEM9zbkshWz8gaX5VVGUEALowCBUWqmzO4VaqM+2w== + +"@swc/core-linux-x64-gnu@1.4.8": + version "1.4.8" + resolved "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.4.8.tgz#76e7fb06e5b6a14ed6dbc0fd00743706d022eb02" + integrity sha512-0WWyIw432wpO/zeGblwq4f2YWam4pn8Z/Ig4KzHMgthR/KmiLU3f0Z7eo45eVmq5vcU7Os1zi/Zb65OOt09q/w== + +"@swc/core-linux-x64-musl@1.4.8": + version "1.4.8" + resolved "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.4.8.tgz#a6e03fe6207fcb9715250c7af260e5ee1bf43c5a" + integrity sha512-p4yxvVS05rBNCrBaSTa20KK88vOwtg8ifTW7ec/yoab0bD5EwzzB8KbDmLLxE6uziFa0sdjF0dfRDwSZPex37Q== + +"@swc/core-win32-arm64-msvc@1.4.8": + version "1.4.8" + resolved "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.4.8.tgz#5daa44087324c49c64fdbb48fdb3aa00218de03b" + integrity sha512-jKuXihxAaqUnbFfvPxtmxjdJfs87F1GdBf33il+VUmSyWCP4BE6vW+/ReDAe8sRNsKyrZ3UH1vI5q1n64csBUA== + +"@swc/core-win32-ia32-msvc@1.4.8": + version "1.4.8" + resolved "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.4.8.tgz#0f1186d2d8bf60c12cfe8ac013b8a520fd850f2e" + integrity sha512-O0wT4AGHrX8aBeH6c2ADMHgagAJc5Kf6W48U5moyYDAkkVnKvtSc4kGhjWhe1Yl0sI0cpYh2In2FxvYsb44eWw== + +"@swc/core-win32-x64-msvc@1.4.8": + version "1.4.8" + resolved "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.4.8.tgz#0bf080132a52e332c7c221d1087a311824746d76" + integrity sha512-C2AYc3A2o+ECciqsJWRgIpp83Vk5EaRzHe7ed/xOWzVd0MsWR+fweEsyOjlmzHfpUxJSi46Ak3/BIZJlhZbXbg== "@swc/core@^1.4.2": - version "1.4.7" - resolved "https://registry.npmjs.org/@swc/core/-/core-1.4.7.tgz#94ac45187fa2fdbd6cbb34dbda089c174ec64c1d" - integrity sha512-I7a9sUxB+z+UCf6KudqrQH/RgLal/S+E+t4uBdbggycLyJe7WvBgPrQlcN5UpEuD9YC2PJ0CN6kgD6ARStg+pg== + version "1.4.8" + resolved "https://registry.npmjs.org/@swc/core/-/core-1.4.8.tgz#de859373a01f499ed27744f6848b28bbb977e81c" + integrity sha512-uY2RSJcFPgNOEg12RQZL197LZX+MunGiKxsbxmh22VfVxrOYGRvh4mPANFlrD1yb38CgmW1wI6YgIi8LkIwmWg== dependencies: "@swc/counter" "^0.1.2" "@swc/types" "^0.1.5" optionalDependencies: - "@swc/core-darwin-arm64" "1.4.7" - "@swc/core-darwin-x64" "1.4.7" - "@swc/core-linux-arm-gnueabihf" "1.4.7" - "@swc/core-linux-arm64-gnu" "1.4.7" - "@swc/core-linux-arm64-musl" "1.4.7" - "@swc/core-linux-x64-gnu" "1.4.7" - "@swc/core-linux-x64-musl" "1.4.7" - "@swc/core-win32-arm64-msvc" "1.4.7" - "@swc/core-win32-ia32-msvc" "1.4.7" - "@swc/core-win32-x64-msvc" "1.4.7" + "@swc/core-darwin-arm64" "1.4.8" + "@swc/core-darwin-x64" "1.4.8" + "@swc/core-linux-arm-gnueabihf" "1.4.8" + "@swc/core-linux-arm64-gnu" "1.4.8" + "@swc/core-linux-arm64-musl" "1.4.8" + "@swc/core-linux-x64-gnu" "1.4.8" + "@swc/core-linux-x64-musl" "1.4.8" + "@swc/core-win32-arm64-msvc" "1.4.8" + "@swc/core-win32-ia32-msvc" "1.4.8" + "@swc/core-win32-x64-msvc" "1.4.8" "@swc/counter@^0.1.2": version "0.1.3" From 99cd49d3753874432eeb18d7297feccc86bfc4f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 10:22:32 +0800 Subject: [PATCH 6/8] build(deps): bump follow-redirects from 1.15.4 to 1.15.6 (#3977) Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2b20022575..3209187b79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4265,9 +4265,9 @@ focus-trap@^7.5.4: tabbable "^6.2.0" follow-redirects@^1.15.0: - version "1.15.4" - resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz" - integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw== + version "1.15.6" + resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== for-each@^0.3.3: version "0.3.3" @@ -7627,14 +7627,7 @@ string_decoder@^1.1.1, string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== From 94eab40798e0c8d3945aa2b1e629669b231d8468 Mon Sep 17 00:00:00 2001 From: Daniel Bayley Date: Fri, 15 Mar 2024 02:46:21 +0000 Subject: [PATCH 7/8] feat(load): update cosmiconfig to v9 to add support for `package.yaml` config (#3976) --- @commitlint/load/package.json | 2 +- @commitlint/load/src/load.test.ts | 8 ++++++++ @commitlint/load/src/utils/load-config.ts | 3 +++ README.md | 1 + docs/reference/configuration.md | 2 +- yarn.lock | 12 ++++++------ 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/@commitlint/load/package.json b/@commitlint/load/package.json index 99dc37cf05..9723626fc1 100644 --- a/@commitlint/load/package.json +++ b/@commitlint/load/package.json @@ -50,7 +50,7 @@ "@commitlint/resolve-extends": "^19.1.0", "@commitlint/types": "^19.0.3", "chalk": "^5.3.0", - "cosmiconfig": "^8.3.6", + "cosmiconfig": "^9.0.0", "cosmiconfig-typescript-loader": "^5.0.0", "lodash.isplainobject": "^4.0.6", "lodash.merge": "^4.6.2", diff --git a/@commitlint/load/src/load.test.ts b/@commitlint/load/src/load.test.ts index fbf1d84ddd..129c1944ed 100644 --- a/@commitlint/load/src/load.test.ts +++ b/@commitlint/load/src/load.test.ts @@ -238,6 +238,7 @@ describe.each([['basic'], ['extends']])('%s config', (template) => { 'commitlint.config.js', 'commitlint.config.mjs', 'package.json', + 'package.yaml', '.commitlintrc', '.commitlintrc.cjs', '.commitlintrc.js', @@ -274,6 +275,13 @@ describe.each([['basic'], ['extends']])('%s config', (template) => { readFileSync(configPath, {encoding: 'utf-8'}) ); return JSON.stringify({commitlint}); + } else if (filename === 'package.yaml') { + const configPath = path.join( + __dirname, + `../fixtures/${template}-config/.commitlintrc.yaml` + ); + const yaml = readFileSync(configPath, {encoding: 'utf-8'}); + return `commitlint:\n${yaml.replace(/^/gm, ' ')}`; } else { const filePath = ['..', 'fixtures', `${template}-config`, filename]; diff --git a/@commitlint/load/src/utils/load-config.ts b/@commitlint/load/src/utils/load-config.ts index a5624620ff..34a8af8039 100644 --- a/@commitlint/load/src/utils/load-config.ts +++ b/@commitlint/load/src/utils/load-config.ts @@ -16,6 +16,7 @@ export interface LoadConfigResult { } const moduleName = 'commitlint'; +const searchStrategy = 'global'; export async function loadConfig( cwd: string, @@ -37,10 +38,12 @@ export async function loadConfig( : defaultLoadersSync; const explorer = cosmiconfig(moduleName, { + searchStrategy, searchPlaces: [ // cosmiconfig overrides default searchPlaces if any new search place is added (For e.g. `*.ts` files), // we need to manually merge default searchPlaces from https://github.com/davidtheclark/cosmiconfig#searchplaces 'package.json', + 'package.yaml', `.${moduleName}rc`, `.${moduleName}rc.json`, `.${moduleName}rc.yaml`, diff --git a/README.md b/README.md index 7786086b48..7fc5051651 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,7 @@ These can be modified by [your own configuration](#config). - `commitlint.config.ts` - `commitlint.config.cts` - `commitlint` field in `package.json` + - `commitlint` field in [`package.yaml`](https://github.com/pnpm/pnpm/pull/1799) - Packages: [cli](./@commitlint/cli), [core](./@commitlint/core) - See [Rules](./docs/reference/rules.md) for a complete list of possible rules - An example configuration can be found at [@commitlint/config-conventional](./@commitlint/config-conventional/src/index.ts) diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index c77d695cb2..94ec728c7f 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -29,7 +29,7 @@ Configuration files are resolved using [cosmiconfig](https://github.com/cosmicon ## Config via `package.json` -You can add `commitlint` field in `package.json` with an object that follows below structure. +You can add a `commitlint` field in `package.json` (or [`package.yaml`](https://github.com/pnpm/pnpm/pull/1799)) with an object that follows the below structure. ## Config option CLI diff --git a/yarn.lock b/yarn.lock index 3209187b79..b348ad1b34 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3417,15 +3417,15 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cosmiconfig@^8.3.6: - version "8.3.6" - resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz" - integrity sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA== +cosmiconfig@^9.0.0: + version "9.0.0" + resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz#34c3fc58287b915f3ae905ab6dc3de258b55ad9d" + integrity sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg== dependencies: + env-paths "^2.2.1" import-fresh "^3.3.0" js-yaml "^4.1.0" parse-json "^5.2.0" - path-type "^4.0.0" cross-env@^7.0.3: version "7.0.3" @@ -3716,7 +3716,7 @@ entities@^4.5.0: resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== -env-paths@^2.2.0: +env-paths@^2.2.0, env-paths@^2.2.1: version "2.2.1" resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz" integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== From a64b417b58b3b1e89f07ff529a29a4af223e9369 Mon Sep 17 00:00:00 2001 From: escapedcat Date: Fri, 15 Mar 2024 10:49:10 +0800 Subject: [PATCH 8/8] v19.2.0 --- @alias/commitlint/CHANGELOG.md | 8 ++++++++ @alias/commitlint/package.json | 4 ++-- @commitlint/cli/CHANGELOG.md | 11 +++++++++++ @commitlint/cli/package.json | 6 +++--- @commitlint/core/CHANGELOG.md | 8 ++++++++ @commitlint/core/package.json | 6 +++--- @commitlint/cz-commitlint/CHANGELOG.md | 8 ++++++++ @commitlint/cz-commitlint/package.json | 4 ++-- @commitlint/load/CHANGELOG.md | 11 +++++++++++ @commitlint/load/package.json | 2 +- @commitlint/prompt-cli/CHANGELOG.md | 8 ++++++++ @commitlint/prompt-cli/package.json | 4 ++-- @commitlint/prompt/CHANGELOG.md | 8 ++++++++ @commitlint/prompt/package.json | 4 ++-- @commitlint/read/CHANGELOG.md | 11 +++++++++++ @commitlint/read/package.json | 6 +++--- @commitlint/travis-cli/CHANGELOG.md | 8 ++++++++ @commitlint/travis-cli/package.json | 4 ++-- CHANGELOG.md | 17 +++++++++++++++++ lerna.json | 2 +- 20 files changed, 119 insertions(+), 21 deletions(-) diff --git a/@alias/commitlint/CHANGELOG.md b/@alias/commitlint/CHANGELOG.md index 3a25dd1c19..e61c3ecd01 100644 --- a/@alias/commitlint/CHANGELOG.md +++ b/@alias/commitlint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [19.2.0](https://github.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) (2024-03-15) + +**Note:** Version bump only for package commitlint + + + + + # [19.1.0](https://github.com/conventional-changelog/commitlint/compare/v19.0.3...v19.1.0) (2024-03-12) **Note:** Version bump only for package commitlint diff --git a/@alias/commitlint/package.json b/@alias/commitlint/package.json index 26282f7779..e234ac38dc 100644 --- a/@alias/commitlint/package.json +++ b/@alias/commitlint/package.json @@ -1,7 +1,7 @@ { "name": "commitlint", "type": "module", - "version": "19.1.0", + "version": "19.2.0", "description": "Lint your commit messages", "files": [ "cli.js" @@ -36,7 +36,7 @@ }, "license": "MIT", "dependencies": { - "@commitlint/cli": "^19.1.0", + "@commitlint/cli": "^19.2.0", "@commitlint/types": "^19.0.3" }, "devDependencies": { diff --git a/@commitlint/cli/CHANGELOG.md b/@commitlint/cli/CHANGELOG.md index 21e28e1193..60ae8fdadb 100644 --- a/@commitlint/cli/CHANGELOG.md +++ b/@commitlint/cli/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [19.2.0](https://github.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) (2024-03-15) + + +### Features + +* **cli:** introduce new --last flag, to stop recommending HEAD~1 ([#3916](https://github.com/conventional-changelog/commitlint/issues/3916)) ([99f4f3f](https://github.com/conventional-changelog/commitlint/commit/99f4f3f4839190a2758083df7ba20b988e7b68a6)) + + + + + # [19.1.0](https://github.com/conventional-changelog/commitlint/compare/v19.0.3...v19.1.0) (2024-03-12) **Note:** Version bump only for package @commitlint/cli diff --git a/@commitlint/cli/package.json b/@commitlint/cli/package.json index 537280175e..da15117aa7 100644 --- a/@commitlint/cli/package.json +++ b/@commitlint/cli/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/cli", "type": "module", - "version": "19.1.0", + "version": "19.2.0", "description": "Lint your commit messages", "files": [ "index.cjs", @@ -50,8 +50,8 @@ "dependencies": { "@commitlint/format": "^19.0.3", "@commitlint/lint": "^19.1.0", - "@commitlint/load": "^19.1.0", - "@commitlint/read": "^19.0.3", + "@commitlint/load": "^19.2.0", + "@commitlint/read": "^19.2.0", "@commitlint/types": "^19.0.3", "execa": "^8.0.1", "yargs": "^17.0.0" diff --git a/@commitlint/core/CHANGELOG.md b/@commitlint/core/CHANGELOG.md index 2431c6a013..5589c6dac1 100644 --- a/@commitlint/core/CHANGELOG.md +++ b/@commitlint/core/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [19.2.0](https://github.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) (2024-03-15) + +**Note:** Version bump only for package @commitlint/core + + + + + # [19.1.0](https://github.com/conventional-changelog/commitlint/compare/v19.0.3...v19.1.0) (2024-03-12) **Note:** Version bump only for package @commitlint/core diff --git a/@commitlint/core/package.json b/@commitlint/core/package.json index a11a9e09c6..28aa97c892 100644 --- a/@commitlint/core/package.json +++ b/@commitlint/core/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/core", "type": "module", - "version": "19.1.0", + "version": "19.2.0", "description": "Lint your commit messages", "main": "lib/core.js", "types": "lib/core.d.ts", @@ -38,8 +38,8 @@ "dependencies": { "@commitlint/format": "^19.0.3", "@commitlint/lint": "^19.1.0", - "@commitlint/load": "^19.1.0", - "@commitlint/read": "^19.0.3" + "@commitlint/load": "^19.2.0", + "@commitlint/read": "^19.2.0" }, "devDependencies": { "@commitlint/utils": "^19.0.0" diff --git a/@commitlint/cz-commitlint/CHANGELOG.md b/@commitlint/cz-commitlint/CHANGELOG.md index 8ccfa63854..8e9d133e79 100644 --- a/@commitlint/cz-commitlint/CHANGELOG.md +++ b/@commitlint/cz-commitlint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [19.2.0](https://github.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) (2024-03-15) + +**Note:** Version bump only for package @commitlint/cz-commitlint + + + + + # [19.1.0](https://github.com/conventional-changelog/commitlint/compare/v19.0.3...v19.1.0) (2024-03-12) diff --git a/@commitlint/cz-commitlint/package.json b/@commitlint/cz-commitlint/package.json index d8e5ed6a0f..6d43cd9cc7 100644 --- a/@commitlint/cz-commitlint/package.json +++ b/@commitlint/cz-commitlint/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/cz-commitlint", "type": "module", - "version": "19.1.0", + "version": "19.2.0", "description": "Commitizen adapter using the commitlint.config.js", "main": "./lib/index.js", "exports": { @@ -44,7 +44,7 @@ }, "dependencies": { "@commitlint/ensure": "^19.0.3", - "@commitlint/load": "^19.1.0", + "@commitlint/load": "^19.2.0", "@commitlint/types": "^19.0.3", "chalk": "^5.3.0", "lodash.isplainobject": "^4.0.6", diff --git a/@commitlint/load/CHANGELOG.md b/@commitlint/load/CHANGELOG.md index 61d36c837e..3ffe983105 100644 --- a/@commitlint/load/CHANGELOG.md +++ b/@commitlint/load/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [19.2.0](https://github.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) (2024-03-15) + + +### Features + +* **load:** update cosmiconfig to v9 to add support for `package.yaml` config ([#3976](https://github.com/conventional-changelog/commitlint/issues/3976)) ([94eab40](https://github.com/conventional-changelog/commitlint/commit/94eab40798e0c8d3945aa2b1e629669b231d8468)) + + + + + # [19.1.0](https://github.com/conventional-changelog/commitlint/compare/v19.0.3...v19.1.0) (2024-03-12) **Note:** Version bump only for package @commitlint/load diff --git a/@commitlint/load/package.json b/@commitlint/load/package.json index 9723626fc1..b879333692 100644 --- a/@commitlint/load/package.json +++ b/@commitlint/load/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/load", "type": "module", - "version": "19.1.0", + "version": "19.2.0", "description": "Load shared commitlint configuration", "main": "lib/load.js", "types": "lib/load.d.ts", diff --git a/@commitlint/prompt-cli/CHANGELOG.md b/@commitlint/prompt-cli/CHANGELOG.md index ba5acb0841..db0b9bf0f7 100644 --- a/@commitlint/prompt-cli/CHANGELOG.md +++ b/@commitlint/prompt-cli/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [19.2.0](https://github.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) (2024-03-15) + +**Note:** Version bump only for package @commitlint/prompt-cli + + + + + # [19.1.0](https://github.com/conventional-changelog/commitlint/compare/v19.0.3...v19.1.0) (2024-03-12) diff --git a/@commitlint/prompt-cli/package.json b/@commitlint/prompt-cli/package.json index e9ed639082..3859afa0e1 100644 --- a/@commitlint/prompt-cli/package.json +++ b/@commitlint/prompt-cli/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/prompt-cli", "type": "module", - "version": "19.1.0", + "version": "19.2.0", "description": "commit prompt using commitlint.config.js", "main": "cli.js", "files": [ @@ -38,7 +38,7 @@ "@commitlint/utils": "^19.0.0" }, "dependencies": { - "@commitlint/prompt": "^19.1.0", + "@commitlint/prompt": "^19.2.0", "execa": "^8.0.1", "inquirer": "^9.2.15" }, diff --git a/@commitlint/prompt/CHANGELOG.md b/@commitlint/prompt/CHANGELOG.md index d8d38db909..b1f688b7ca 100644 --- a/@commitlint/prompt/CHANGELOG.md +++ b/@commitlint/prompt/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [19.2.0](https://github.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) (2024-03-15) + +**Note:** Version bump only for package @commitlint/prompt + + + + + # [19.1.0](https://github.com/conventional-changelog/commitlint/compare/v19.0.3...v19.1.0) (2024-03-12) **Note:** Version bump only for package @commitlint/prompt diff --git a/@commitlint/prompt/package.json b/@commitlint/prompt/package.json index 365be68c79..392e14c7a0 100644 --- a/@commitlint/prompt/package.json +++ b/@commitlint/prompt/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/prompt", "type": "module", - "version": "19.1.0", + "version": "19.2.0", "description": "commitizen prompt using commitlint.config.js", "main": "./lib/index.js", "files": [ @@ -46,7 +46,7 @@ }, "dependencies": { "@commitlint/ensure": "^19.0.3", - "@commitlint/load": "^19.1.0", + "@commitlint/load": "^19.2.0", "@commitlint/types": "^19.0.3", "chalk": "^5.3.0", "inquirer": "^9.2.15" diff --git a/@commitlint/read/CHANGELOG.md b/@commitlint/read/CHANGELOG.md index 595fb77da6..22c4d1211a 100644 --- a/@commitlint/read/CHANGELOG.md +++ b/@commitlint/read/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [19.2.0](https://github.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) (2024-03-15) + + +### Features + +* **cli:** introduce new --last flag, to stop recommending HEAD~1 ([#3916](https://github.com/conventional-changelog/commitlint/issues/3916)) ([99f4f3f](https://github.com/conventional-changelog/commitlint/commit/99f4f3f4839190a2758083df7ba20b988e7b68a6)) + + + + + ## [19.0.3](https://github.com/conventional-changelog/commitlint/compare/v19.0.2...v19.0.3) (2024-02-28) **Note:** Version bump only for package @commitlint/read diff --git a/@commitlint/read/package.json b/@commitlint/read/package.json index 59e8fbed5d..0cecf6c04b 100644 --- a/@commitlint/read/package.json +++ b/@commitlint/read/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/read", "type": "module", - "version": "19.0.3", + "version": "19.2.0", "description": "Read commit messages from a specified range or last edit", "main": "lib/read.js", "types": "lib/read.d.ts", @@ -44,9 +44,9 @@ "dependencies": { "@commitlint/top-level": "^19.0.0", "@commitlint/types": "^19.0.3", + "execa": "^8.0.1", "git-raw-commits": "^4.0.0", - "minimist": "^1.2.8", - "execa": "^8.0.1" + "minimist": "^1.2.8" }, "gitHead": "70f7f4688b51774e7ac5e40e896cdaa3f132b2bc" } diff --git a/@commitlint/travis-cli/CHANGELOG.md b/@commitlint/travis-cli/CHANGELOG.md index b38f217a12..005dd368a3 100644 --- a/@commitlint/travis-cli/CHANGELOG.md +++ b/@commitlint/travis-cli/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [19.2.0](https://github.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) (2024-03-15) + +**Note:** Version bump only for package @commitlint/travis-cli + + + + + # [19.1.0](https://github.com/conventional-changelog/commitlint/compare/v19.0.3...v19.1.0) (2024-03-12) diff --git a/@commitlint/travis-cli/package.json b/@commitlint/travis-cli/package.json index f2b0076520..a34ae6cfe2 100644 --- a/@commitlint/travis-cli/package.json +++ b/@commitlint/travis-cli/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/travis-cli", "type": "module", - "version": "19.1.0", + "version": "19.2.0", "description": "Lint all relevant commits for a change or PR on Travis CI", "main": "lib/cli.js", "types": "lib/cli.d.ts", @@ -43,7 +43,7 @@ "@commitlint/utils": "^19.0.0" }, "dependencies": { - "@commitlint/cli": "^19.1.0", + "@commitlint/cli": "^19.2.0", "execa": "^8.0.1" }, "gitHead": "70f7f4688b51774e7ac5e40e896cdaa3f132b2bc" diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e3fb9768f..ba3437a0dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,23 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [19.2.0](https://github.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) (2024-03-15) + + +### Bug Fixes + +* update dependency inquirer to v9.2.16 ([#3972](https://github.com/conventional-changelog/commitlint/issues/3972)) ([ea1ab9c](https://github.com/conventional-changelog/commitlint/commit/ea1ab9cc8048a2b715473c878641d1e189daaf1c)) + + +### Features + +* **cli:** introduce new --last flag, to stop recommending HEAD~1 ([#3916](https://github.com/conventional-changelog/commitlint/issues/3916)) ([99f4f3f](https://github.com/conventional-changelog/commitlint/commit/99f4f3f4839190a2758083df7ba20b988e7b68a6)) +* **load:** update cosmiconfig to v9 to add support for `package.yaml` config ([#3976](https://github.com/conventional-changelog/commitlint/issues/3976)) ([94eab40](https://github.com/conventional-changelog/commitlint/commit/94eab40798e0c8d3945aa2b1e629669b231d8468)) + + + + + # [19.1.0](https://github.com/conventional-changelog/commitlint/compare/v19.0.3...v19.1.0) (2024-03-12) diff --git a/lerna.json b/lerna.json index 635819278e..98418a0b9d 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "lerna": "4", "npmClient": "yarn", "useWorkspaces": true, - "version": "19.1.0" + "version": "19.2.0" } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy