From 32ffa7f8ec7e7bf2d501ada689afcd20d47700bb Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Thu, 22 Sep 2022 13:30:10 +0200 Subject: [PATCH 1/4] ci(ci.yml): set version v3 to actions/checkout --- .github/workflows/ci.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f2d9517..e5a01125 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,8 @@ name: CI - -on: - pull_request: - push: - +"on": + pull_request: null + push: null jobs: - build: runs-on: ${{ matrix.os }} strategy: @@ -16,25 +13,23 @@ jobs: - 14 - 16 - 17 - os: [ubuntu-latest, macos-latest, windows-latest] - + os: + - ubuntu-latest + - macos-latest + - windows-latest steps: - name: 🛑 Cancel Previous Runs uses: styfle/cancel-workflow-action@0.9.1 with: access_token: ${{ secrets.GITHUB_TOKEN }} - - name: ⬇️ Checkout - uses: actions/checkout@v2 - + uses: actions/checkout@v3 - name: ⎔ Setup node ${{ matrix.node }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} cache: npm - - name: 📥 Download deps run: npm ci - - name: Test run: npm test From bfad899b4d6001d1cf836e8a0fc60da9d50d0bfa Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Thu, 22 Sep 2022 13:44:08 +0200 Subject: [PATCH 2/4] ci(ci.yml): set version v3 to actions/setup-node --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5a01125..d133d22e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - name: ⬇️ Checkout uses: actions/checkout@v3 - name: ⎔ Setup node ${{ matrix.node }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: npm From a3be70ccf67d9800ce4e82b8ce2a381d13180d5d Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Sat, 27 Nov 2021 19:05:13 +0100 Subject: [PATCH 3/4] feat(config): add 'extends' configuration option Give users the option to extend Options with a deep merge with the object inside the "extends" configuration option fix #145 --- index.js | 5 +++++ package.json | 1 + 2 files changed, 6 insertions(+) diff --git a/index.js b/index.js index 7a4586d2..a526cfd3 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ var engine = require('./engine'); var conventionalCommitTypes = require('conventional-commit-types'); var configLoader = require('commitizen').configLoader; +var merge = require('lodash.merge'); var config = configLoader.load() || {}; var options = { @@ -28,6 +29,10 @@ var options = { 100 }; +if (!!config.extends) { + options = merge(options, config.extends); +} + (function(options) { try { var commitlintLoad = require('@commitlint/load'); diff --git a/package.json b/package.json index 856b0624..386bfc62 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "commitizen": "^4.0.3", "conventional-commit-types": "^3.0.0", "lodash.map": "^4.5.1", + "lodash.merge": "^4.6.2", "longest": "^2.0.1", "word-wrap": "^1.0.3" }, From 98be5c96fcd0f3ac49f1d63d882d9206d86f9013 Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Sat, 27 Nov 2021 19:13:20 +0100 Subject: [PATCH 4/4] feat(config): extends option tries to require("") if is a string instead of an object --- index.js | 5 ++++- package-lock.json | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a526cfd3..3c5307d2 100644 --- a/index.js +++ b/index.js @@ -30,7 +30,10 @@ var options = { }; if (!!config.extends) { - options = merge(options, config.extends); + options = merge( + options, + typeof config.extends == 'string' ? require(config.extends) : config.extends + ); } (function(options) { diff --git a/package-lock.json b/package-lock.json index 8a9bc283..47573b0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "commitizen": "^4.0.3", "conventional-commit-types": "^3.0.0", "lodash.map": "^4.5.1", + "lodash.merge": "^4.6.2", "longest": "^2.0.1", "word-wrap": "^1.0.3" }, @@ -2837,6 +2838,11 @@ "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=" }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "node_modules/lodash.uniqby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", @@ -9976,6 +9982,11 @@ "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=" }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "lodash.uniqby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz",