From 915125f135a592c2aea444a741e974928672c114 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sat, 1 Jun 2019 12:11:22 +0000 Subject: [PATCH 01/29] chore(package): update ava to version 2.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ae5ed99..e024280 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "test" ], "devDependencies": { - "ava": "^1.0.1", + "ava": "^2.0.0", "nyc": "^14.0.0", "xo": "^0.24.0" } From 9e1767370ab47363adcf0854e08285adcf957bd9 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2019 04:22:23 +0000 Subject: [PATCH 02/29] chore(package): update xo to version 0.25.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e024280..07d6bda 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,6 @@ "devDependencies": { "ava": "^2.0.0", "nyc": "^14.0.0", - "xo": "^0.24.0" + "xo": "^0.25.0" } } From 26f8410a6f90f233f6c954e46560a5b411d1a8a3 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2019 01:07:09 +0000 Subject: [PATCH 03/29] chore(package): update nyc to version 15.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 07d6bda..dc404d0 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ ], "devDependencies": { "ava": "^2.0.0", - "nyc": "^14.0.0", + "nyc": "^15.0.0", "xo": "^0.25.0" } } From 97666070fdec866d0f6d2cc7336f2960d2c8bd1d Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Sun, 19 Jan 2020 15:20:39 +0000 Subject: [PATCH 04/29] chore(package): update ava to version 3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc404d0..97e627a 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "test" ], "devDependencies": { - "ava": "^2.0.0", + "ava": "^3.0.0", "nyc": "^15.0.0", "xo": "^0.25.0" } From 338afb006ccf1445824aa5218389daa95aa321e6 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2020 23:50:45 +0000 Subject: [PATCH 05/29] chore(package): update xo to version 0.26.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 97e627a..7fc401f 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,6 @@ "devDependencies": { "ava": "^3.0.0", "nyc": "^15.0.0", - "xo": "^0.25.0" + "xo": "^0.26.0" } } From bcbde3dd166dd0750ea77701d2381160b87bcaf0 Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Thu, 13 Feb 2020 09:59:14 +0530 Subject: [PATCH 06/29] Create .mergify.yml [skip ci] --- .mergify.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .mergify.yml diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 0000000..f2a253f --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,8 @@ +pull_request_rules: + - name: automatic merge for Greenkeeper pull requests + conditions: + - author=greenkeeper[bot] + - status-success=greenkeeper/verify + actions: + merge: + method: merge From d69ac7a52dade22546c624cddda09851bf35fcb8 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 19:34:03 +0000 Subject: [PATCH 07/29] chore(package): update xo to version 0.27.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7fc401f..d07b477 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,6 @@ "devDependencies": { "ava": "^3.0.0", "nyc": "^15.0.0", - "xo": "^0.26.0" + "xo": "^0.27.0" } } From 8389d9439d110e99bd777053822c0c24b1e9442c Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2020 11:13:26 +0000 Subject: [PATCH 08/29] chore(package): update xo to version 0.28.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d07b477..406be9e 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,6 @@ "devDependencies": { "ava": "^3.0.0", "nyc": "^15.0.0", - "xo": "^0.27.0" + "xo": "^0.28.0" } } From 3bc8c414643a2162b89a2ebb743823b6afa89e33 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2020 21:12:36 +0000 Subject: [PATCH 09/29] chore(package): update xo to version 0.29.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 406be9e..924332e 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,6 @@ "devDependencies": { "ava": "^3.0.0", "nyc": "^15.0.0", - "xo": "^0.28.0" + "xo": "^0.29.0" } } From 4e7551a1646a6fa5053eef9fe8a43c9d3dbdfdad Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Sat, 25 Apr 2020 16:11:41 +0000 Subject: [PATCH 10/29] chore(package): update xo to version 0.30.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 924332e..39e542e 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,6 @@ "devDependencies": { "ava": "^3.0.0", "nyc": "^15.0.0", - "xo": "^0.29.0" + "xo": "^0.30.0" } } From 46ac74fec1b60e7e7d2612f170facb4f459a2570 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Thu, 7 May 2020 11:22:43 +0000 Subject: [PATCH 11/29] chore(readme): remove Greenkeeper badge --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 1e1a580..7200aa5 100644 --- a/readme.md +++ b/readme.md @@ -3,7 +3,7 @@ [![Build Status](https://travis-ci.org/palashmon/clone-array-objects.svg?branch=master)](https://travis-ci.org/palashmon/clone-array-objects) [![npm](https://img.shields.io/npm/v/clone-array-objects.svg)](https://www.npmjs.org/package/clone-array-objects) [![codecov](https://codecov.io/gh/palashmon/clone-array-objects/branch/master/graph/badge.svg)](https://codecov.io/gh/palashmon/clone-array-objects) -[![Gzip Size](https://img.badgesize.io/https://unpkg.com/clone-array-objects?compression=gzip)](https://bundlephobia.com/result?p=clone-array-objects) [![Greenkeeper badge](https://badges.greenkeeper.io/palashmon/clone-array-objects.svg)](https://greenkeeper.io/) +[![Gzip Size](https://img.badgesize.io/https://unpkg.com/clone-array-objects?compression=gzip)](https://bundlephobia.com/result?p=clone-array-objects) Tiny module to clone an array of objects From 0e164c0d27e1fc2c95d121b5aac7a1905c0db119 Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Thu, 7 May 2020 17:35:28 +0530 Subject: [PATCH 12/29] Update .travis.yml --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index afc313a..0e7b403 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: node_js node_js: - - '10' - - '8' + - node notifications: email: false before_install: From bab73ce264c4de4df9b5efa19a6ad0b3f970f8a1 Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Thu, 7 May 2020 17:59:07 +0530 Subject: [PATCH 13/29] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0e7b403..2f689b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - node + - '8' notifications: email: false before_install: From 1cbde251090127012729eae11de5ad59f36fc781 Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Mon, 24 Apr 2023 17:00:58 +0530 Subject: [PATCH 14/29] chore: add ci pipeline configuration --- .github/dependabot.yml | 11 ++++++++ .github/workflows/main.yaml | 22 +++++++++++++++ index.js | 21 ++++++++++----- package.json | 13 ++++----- test.js | 54 +++++++++++++++++++++++++------------ 5 files changed, 92 insertions(+), 29 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/main.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e8c2dfc --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "npm" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..74f94b7 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,22 @@ +name: CI +on: + - push + - pull_request +jobs: + test: + name: Node.js ${{ matrix.node-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: + - 18 + - 16 + - 14 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test diff --git a/index.js b/index.js index cbf90dd..c6664e4 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,15 @@ -module.exports = (arrayInput = []) => { - if (!Array.isArray(arrayInput)) { - throw new TypeError(`Expected an array, got ${typeof arrayInput}`); - } - return arrayInput.map(obj => ({...obj})); -}; +function cloneArrayObjects(arrayInput = []) { + if (!Array.isArray(arrayInput)) { + throw new TypeError(`Expected an array, got ${typeof arrayInput}`); + } + + return arrayInput.map((object) => { + if (typeof object !== "object" || object === null) { + throw new TypeError(`Expected an object, got ${typeof object}`); + } + + return { ...object }; + }); +} + +export default cloneArrayObjects; diff --git a/package.json b/package.json index 39e542e..29f1038 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clone-array-objects", - "version": "1.0.0", + "version": "1.0.2", "description": "Clone an array of objects", "license": "MIT", "repository": "https://github.com/palashmon/clone-array-objects", @@ -10,7 +10,7 @@ "url": "https://github.com/palashmon" }, "engines": { - "node": ">=8" + "node": ">=14" }, "scripts": { "test": "xo && ava", @@ -30,8 +30,9 @@ "test" ], "devDependencies": { - "ava": "^3.0.0", + "ava": "^5.1.0", "nyc": "^15.0.0", - "xo": "^0.30.0" - } -} + "xo": "^0.54.0" + }, + "type": "module" +} \ No newline at end of file diff --git a/test.js b/test.js index 59711ae..7d62404 100644 --- a/test.js +++ b/test.js @@ -1,24 +1,44 @@ import test from 'ava'; -import cloneArrayObjects from '.'; +import cloneArrayObjects from './index.js'; -test('Return typeerror when arrayInput is not an array.', t => { - const err = t.throws(() => { - cloneArrayObjects(23); - }, TypeError); - t.is(err.message, 'Expected an array, got number'); +test('should return a new array with cloned objects', t => { + const input = [ + {name: 'John', age: 30}, + {name: 'Jane', age: 25}, + ]; + const output = cloneArrayObjects(input); + + t.not(output, input); // Should not modify the original array + t.deepEqual(output, input); // Should have the same values as the input +}); + +test('should throw a TypeError if the input is not an array', t => { + const input = 'not an array'; + + const error = t.throws(() => cloneArrayObjects(input)); + + t.is(error.message, `Expected an array, got ${typeof input}`); +}); + +test('should throw a TypeError if any object in the array is null', t => { + const input = [{name: 'John', age: 30}, null]; + + const error = t.throws(() => cloneArrayObjects(input)); + + t.is(error.message, 'Expected an object, got object'); }); -test('Return empty array when no valid input passed.', t => { - t.deepEqual(cloneArrayObjects(), []); - t.deepEqual(cloneArrayObjects([]), []); +test('should throw a TypeError if any object in the array is not an object', t => { + const input = [{name: 'John', age: 30}, 'not an object']; + + const error = t.throws(() => cloneArrayObjects(input)); + + t.is(error.message, 'Expected an object, got string'); }); -test('Test clone', t => { - const actual = [{a: 1}, {b: 2}]; - const expected = [{a: 1}, {b: 2}]; - const modified = [{a: 1}, {b: 3}]; - t.deepEqual(cloneArrayObjects(actual), expected); - expected[1].b = 3; - t.notDeepEqual(cloneArrayObjects(actual), expected); - t.deepEqual(modified, expected); +test('should return an empty array if the input is an empty array', t => { + const input = []; + const output = cloneArrayObjects(input); + + t.deepEqual(output, []); }); From a90e1d32dcfc797c6f9ee75942183ee30adc7a8e Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Mon, 24 Apr 2023 17:07:43 +0530 Subject: [PATCH 15/29] fix: lint issues --- index.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index c6664e4..4cedda9 100644 --- a/index.js +++ b/index.js @@ -1,15 +1,15 @@ function cloneArrayObjects(arrayInput = []) { - if (!Array.isArray(arrayInput)) { - throw new TypeError(`Expected an array, got ${typeof arrayInput}`); - } + if (!Array.isArray(arrayInput)) { + throw new TypeError(`Expected an array, got ${typeof arrayInput}`); + } - return arrayInput.map((object) => { - if (typeof object !== "object" || object === null) { - throw new TypeError(`Expected an object, got ${typeof object}`); - } + return arrayInput.map(object => { + if (typeof object !== 'object' || object === null) { + throw new TypeError(`Expected an object, got ${typeof object}`); + } - return { ...object }; - }); + return {...object}; + }); } export default cloneArrayObjects; From 3e6393f25137361811ae9a4729957fa129386238 Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Mon, 24 Apr 2023 17:08:51 +0530 Subject: [PATCH 16/29] docs: update readme to include new ci badge --- readme.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index 7200aa5..b2392e9 100644 --- a/readme.md +++ b/readme.md @@ -1,11 +1,6 @@ -# clone-array-objects +# clone-array-objects ![CI](https://github.com/palashmon/clone-array-objects/actions/workflows/main.yaml/badge.svg) -[![Build Status](https://travis-ci.org/palashmon/clone-array-objects.svg?branch=master)](https://travis-ci.org/palashmon/clone-array-objects) -[![npm](https://img.shields.io/npm/v/clone-array-objects.svg)](https://www.npmjs.org/package/clone-array-objects) -[![codecov](https://codecov.io/gh/palashmon/clone-array-objects/branch/master/graph/badge.svg)](https://codecov.io/gh/palashmon/clone-array-objects) -[![Gzip Size](https://img.badgesize.io/https://unpkg.com/clone-array-objects?compression=gzip)](https://bundlephobia.com/result?p=clone-array-objects) - -Tiny module to clone an array of objects +> Tiny module to clone an array of objects ## Install From 2c23e13955b7658dd6872a709ef34e900ec06e61 Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Fri, 11 Aug 2023 10:34:20 +0530 Subject: [PATCH 17/29] fix: update ci/cd workflow --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 74f94b7..ac3e326 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -10,9 +10,9 @@ jobs: fail-fast: false matrix: node-version: + - 20 - 18 - 16 - - 14 steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 From 0e5e43e4f4e92115ae0ad096b6f9a9a2454ffbc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 16:32:08 +0000 Subject: [PATCH 18/29] Bump xo from 0.54.2 to 0.56.0 Bumps [xo](https://github.com/xojs/xo) from 0.54.2 to 0.56.0. - [Release notes](https://github.com/xojs/xo/releases) - [Commits](https://github.com/xojs/xo/compare/v0.54.2...v0.56.0) --- updated-dependencies: - dependency-name: xo dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 29f1038..70f77a5 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "devDependencies": { "ava": "^5.1.0", "nyc": "^15.0.0", - "xo": "^0.54.0" + "xo": "^0.56.0" }, "type": "module" } \ No newline at end of file From 2b09fd644893e3a83701d2845acb0c0b1689a0f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:59:46 +0000 Subject: [PATCH 19/29] Bump ava from 5.3.1 to 6.0.1 Bumps [ava](https://github.com/avajs/ava) from 5.3.1 to 6.0.1. - [Release notes](https://github.com/avajs/ava/releases) - [Commits](https://github.com/avajs/ava/compare/v5.3.1...v6.0.1) --- updated-dependencies: - dependency-name: ava dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 70f77a5..88a5d14 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "test" ], "devDependencies": { - "ava": "^5.1.0", + "ava": "^6.0.1", "nyc": "^15.0.0", "xo": "^0.56.0" }, From 4415310016a001679f7695c34013956c882c235b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:11:50 +0000 Subject: [PATCH 20/29] Bump xo from 0.56.0 to 0.57.0 Bumps [xo](https://github.com/xojs/xo) from 0.56.0 to 0.57.0. - [Release notes](https://github.com/xojs/xo/releases) - [Commits](https://github.com/xojs/xo/compare/v0.56.0...v0.57.0) --- updated-dependencies: - dependency-name: xo dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 88a5d14..50f93e2 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "devDependencies": { "ava": "^6.0.1", "nyc": "^15.0.0", - "xo": "^0.56.0" + "xo": "^0.57.0" }, "type": "module" } \ No newline at end of file From 6632c463ab2451ad3a4ab3e7aa60e15e7995a5ef Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Thu, 22 Feb 2024 12:49:24 +0530 Subject: [PATCH 21/29] chore: add dependabot version updates --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e8c2dfc..bb5d013 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,7 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + ignore: + # For all packages, ignore all patch updates + - dependency-name: "*" + update-types: ["version-update:semver-major"] From f808c9b457f69411a641efdb2f75c11bcbb2541a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:35:50 +0000 Subject: [PATCH 22/29] chore(deps-dev): bump xo from 0.57.0 to 0.58.0 Bumps [xo](https://github.com/xojs/xo) from 0.57.0 to 0.58.0. - [Release notes](https://github.com/xojs/xo/releases) - [Commits](https://github.com/xojs/xo/compare/v0.57.0...v0.58.0) --- updated-dependencies: - dependency-name: xo dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 50f93e2..2279492 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "devDependencies": { "ava": "^6.0.1", "nyc": "^15.0.0", - "xo": "^0.57.0" + "xo": "^0.58.0" }, "type": "module" } \ No newline at end of file From 83a73a96560b6e674405a14f64d536560ff86de5 Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Wed, 3 Apr 2024 18:55:38 +0530 Subject: [PATCH 23/29] chore: add stale GitHub action --- .github/workflows/stale.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..8a86964 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,26 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale +name: Mark stale issues and pull requests +on: + schedule: + - cron: "*/10 5 * * *" +jobs: + stale: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-stale: 365 + stale-issue-message: 'This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.' + stale-pr-message: 'This PR is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.' + close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.' + close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity.' + exempt-issue-labels: 'Help Wanted, Good first issue, Never gets stale' + exempt-pr-labels: 'Help Wanted, Never gets stale' From 09379d642847f21ddd2ebae00d929d7861c09367 Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Wed, 3 Apr 2024 22:07:49 +0530 Subject: [PATCH 24/29] chore: update dependabot action --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bb5d013..fe8a7e5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,3 +13,8 @@ updates: # For all packages, ignore all patch updates - dependency-name: "*" update-types: ["version-update:semver-major"] + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" From e2cbf16150f2005721adf6e19512804595f2a16e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:38:56 +0000 Subject: [PATCH 25/29] chore(deps): bump actions/stale from 5 to 9 Bumps [actions/stale](https://github.com/actions/stale) from 5 to 9. - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/v5...v9) --- updated-dependencies: - dependency-name: actions/stale dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 8a86964..5158023 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -14,7 +14,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/stale@v5 + - uses: actions/stale@v9 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 365 From 721358497a71626b5657ec10115a7f26766f34ea Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Wed, 3 Apr 2024 22:39:11 +0530 Subject: [PATCH 26/29] chore(actions): remove node 16 from actions --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ac3e326..c3cd2a9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -10,9 +10,9 @@ jobs: fail-fast: false matrix: node-version: + - 21 - 20 - 18 - - 16 steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 From 7e55c3d686c5918c7f0dace3bd2464c7da144e01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:10:01 +0000 Subject: [PATCH 27/29] chore(deps): bump actions/setup-node from 3 to 4 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c3cd2a9..1ff0bc1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -15,7 +15,7 @@ jobs: - 18 steps: - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install From 7d7c584c80df75c8e855a27ea842a908f76a8a33 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 03:11:28 +0000 Subject: [PATCH 28/29] chore(deps): bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1ff0bc1..bc2d176 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -14,7 +14,7 @@ jobs: - 20 - 18 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} From 1468b15bfaf207344081df27615ac597cde56c7d Mon Sep 17 00:00:00 2001 From: Palash Mondal Date: Thu, 4 Apr 2024 12:11:21 +0530 Subject: [PATCH 29/29] chore: add npm publish action --- .github/workflows/npm-publish.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..18a369a --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,28 @@ +name: Publish Package to npmjs +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "20.x" + - run: npm i + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "20.x" + registry-url: "https://registry.npmjs.org" + - run: npm i + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}