From f19c37469c72dce55643e84d7abe004dc4e7954a Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Thu, 27 Jan 2022 09:29:28 +0000 Subject: [PATCH 01/13] Update dependabot.yml (#171) --- .github/dependabot.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e549772..dfa7fa6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,16 +1,13 @@ version: 2 updates: - - package-ecosystem: github-actions - directory: '/' - ignore: - - dependency-name: "actions/*" - update-types: - ["version-update:semver-minor", "version-update:semver-patch"] + - package-ecosystem: "github-actions" + directory: "/" schedule: - interval: daily + interval: "monthly" open-pull-requests-limit: 10 - - package-ecosystem: npm - directory: '/' + + - package-ecosystem: "npm" + directory: "/" schedule: - interval: daily + interval: "weekly" open-pull-requests-limit: 10 From 02549bf3a0da2b903b0107339456f975468a9312 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 02:06:00 +0000 Subject: [PATCH 02/13] build(deps): bump actions/setup-node from 2 to 3 (#172) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2 to 3. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .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 503e927..890ba42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Install Dependencies From 0cf2048f70d02862bcd24e1ce03f18446e7d57fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Mar 2022 02:07:35 +0000 Subject: [PATCH 03/13] build(deps-dev): bump tap from 15.2.3 to 16.0.1 (#174) Bumps [tap](https://github.com/tapjs/node-tap) from 15.2.3 to 16.0.1. - [Release notes](https://github.com/tapjs/node-tap/releases) - [Commits](https://github.com/tapjs/node-tap/compare/v15.2.3...v16.0.1) --- updated-dependencies: - dependency-name: tap dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 51b6ca1..315d0fd 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "fastify": "^3.3.0", "proxyquire": "^2.1.3", "standard": "^16.0.3", - "tap": "^15.0.2", + "tap": "^16.0.1", "tsd": "^0.19.0", "typescript": "^4.0.5" }, From e50ca6655c168f01542fa293a99ef964f5183947 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 02:07:15 +0000 Subject: [PATCH 04/13] build(deps): bump actions/checkout from 2 to 3 (#175) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [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/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .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 890ba42..89c79e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - ubuntu-latest - windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js uses: actions/setup-node@v3 with: From b275a5b5919f2e6111ca6373150fa892655a1244 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 02:07:25 +0000 Subject: [PATCH 05/13] build(deps-dev): bump tsd from 0.19.1 to 0.20.0 (#176) Bumps [tsd](https://github.com/SamVerschueren/tsd) from 0.19.1 to 0.20.0. - [Release notes](https://github.com/SamVerschueren/tsd/releases) - [Commits](https://github.com/SamVerschueren/tsd/compare/v0.19.1...v0.20.0) --- updated-dependencies: - dependency-name: tsd dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 315d0fd..644b1a5 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "proxyquire": "^2.1.3", "standard": "^16.0.3", "tap": "^16.0.1", - "tsd": "^0.19.0", + "tsd": "^0.20.0", "typescript": "^4.0.5" }, "dependencies": {} From ae77a5ce08adf59f0fb657c7347a803988e47d22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 03:09:11 +0000 Subject: [PATCH 06/13] build(deps-dev): bump standard from 16.0.4 to 17.0.0 (#177) Bumps [standard](https://github.com/standard/standard) from 16.0.4 to 17.0.0. - [Release notes](https://github.com/standard/standard/releases) - [Changelog](https://github.com/standard/standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/standard/standard/compare/v16.0.4...v17.0.0) --- updated-dependencies: - dependency-name: standard dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 644b1a5..1f239d7 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@types/node": "^17.0.0", "fastify": "^3.3.0", "proxyquire": "^2.1.3", - "standard": "^16.0.3", + "standard": "^17.0.0", "tap": "^16.0.1", "tsd": "^0.20.0", "typescript": "^4.0.5" From 93e0a8d7086aad9e5ba6df18e83122f97fa7e138 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Tue, 17 May 2022 12:57:56 +0100 Subject: [PATCH 07/13] ci: migrate to fastify reusable workflow (#180) --- .github/workflows/ci.yml | 58 +++++----------------------------------- README.md | 2 -- 2 files changed, 6 insertions(+), 54 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89c79e9..32b3d16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,61 +1,15 @@ name: CI -'on': + +on: push: paths-ignore: - - docs/** + - 'docs/**' - '*.md' pull_request: paths-ignore: - - docs/** + - 'docs/**' - '*.md' + jobs: test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - node-version: - - 10 - - 12 - - 14 - - 16 - os: - - macos-latest - - ubuntu-latest - - windows-latest - steps: - - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - name: Install Dependencies - run: | - npm install --ignore-scripts - - name: Run Tests - run: | - npm run test:ci - - name: Coveralls Parallel - uses: coverallsapp/github-action@1.1.3 - with: - github-token: ${{ secrets.github_token }} - parallel: true - flag-name: run-${{ matrix.node-version }}-${{ matrix.os }} - coverage: - needs: test - runs-on: ubuntu-latest - steps: - - name: Coveralls Finished - uses: coverallsapp/github-action@1.1.3 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - parallel-finished: true - automerge: - needs: test - runs-on: ubuntu-latest - permissions: - pull-requests: write - contents: write - steps: - - uses: fastify/github-action-merge-dependabot@v3 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3 diff --git a/README.md b/README.md index 5c41978..128f83c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ ![CI](https://github.com/fastify/fastify-plugin/workflows/CI/badge.svg?branch=master) [![NPM version](https://img.shields.io/npm/v/fastify-plugin.svg?style=flat)](https://www.npmjs.com/package/fastify-plugin) -[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-plugin/badge.svg)](https://snyk.io/test/github/fastify/fastify-plugin) -[![Coverage Status](https://coveralls.io/repos/github/fastify/fastify-plugin/badge.svg?branch=master)](https://coveralls.io/github/fastify/fastify-plugin?branch=master) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/) `fastify-plugin` is a plugin helper for [Fastify](https://github.com/fastify/fastify). From 05bf6e1de6ae2dbd2faa020786ae10bf22a60e35 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Fri, 10 Jun 2022 20:09:35 +0100 Subject: [PATCH 08/13] chore(.gitignore): use updated skeleton template (#181) --- .gitignore | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1992952..c1b9a5c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ npm-debug.log* yarn-debug.log* yarn-error.log* lerna-debug.log* +.pnpm-debug.log* # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json @@ -53,6 +54,9 @@ web_modules/ # Optional eslint cache .eslintcache +# Optional stylelint cache +.stylelintcache + # Microbundle cache .rpt2_cache/ .rts2_cache_cjs/ @@ -68,9 +72,12 @@ web_modules/ # Yarn Integrity file .yarn-integrity -# dotenv environment variables file +# dotenv environment variable files .env -.env.test +.env.development.local +.env.test.local +.env.production.local +.env.local # parcel-bundler cache (https://parceljs.org/) .cache @@ -93,6 +100,13 @@ dist # vuepress build output .vuepress/dist +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + # Serverless directories .serverless/ @@ -123,6 +137,7 @@ dist # lock files package-lock.json +pnpm-lock.yaml yarn.lock # editor files From 711d006bf2bcbe74e8ffec6bac041847c9c8765c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 18 Jun 2022 11:29:51 +0200 Subject: [PATCH 09/13] build(deps-dev): bump fastify from 3.29.0 to 4.0.1 (#182) --- README.md | 7 ++++--- package.json | 2 +- test/bundlers.test.js | 2 +- test/checkVersion.test.js | 6 +++--- test/test.js | 12 ++++++------ 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 128f83c..32c2224 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ When you build plugins for Fastify and you want that them to be accessible in th 1. Use the `skip-override` hidden property 2. Use this module +__Note: the v4.x series of this module covers Fastify v4__ __Note: the v2.x & v3.x series of this module covers Fastify v3. For Fastify v2 support, refer to the v1.x series.__ ## Usage @@ -50,7 +51,7 @@ const fp = require('fastify-plugin') module.exports = fp(function (fastify, opts, next) { // your plugin code next() -}, { fastify: '3.x' }) +}, { fastify: '4.x' }) ``` If you need to check the Fastify version only, you can pass just the version string. @@ -69,7 +70,7 @@ function plugin (fastify, opts, next) { } module.exports = fp(plugin, { - fastify: '3.x', + fastify: '4.x', name: 'your-plugin-name' }) ``` @@ -86,7 +87,7 @@ function plugin (fastify, opts, next) { } module.exports = fp(plugin, { - fastify: '3.x', + fastify: '4.x', decorators: { fastify: ['plugin1', 'plugin2'], reply: ['compress'] diff --git a/package.json b/package.json index 1f239d7..4de0a1a 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "homepage": "https://github.com/fastify/fastify-plugin#readme", "devDependencies": { "@types/node": "^17.0.0", - "fastify": "^3.3.0", + "fastify": "^4.0.1", "proxyquire": "^2.1.3", "standard": "^17.0.0", "tap": "^16.0.1", diff --git a/test/bundlers.test.js b/test/bundlers.test.js index 7ae9e39..a48ff5b 100644 --- a/test/bundlers.test.js +++ b/test/bundlers.test.js @@ -20,7 +20,7 @@ test('webpack removes require.main.filename', (t) => { fp((fastify, opts, next) => { next() }, { - fastify: '^3.0.0' + fastify: '^4.0.0' }) t.end() diff --git a/test/checkVersion.test.js b/test/checkVersion.test.js index 3989cf3..f64a8fa 100644 --- a/test/checkVersion.test.js +++ b/test/checkVersion.test.js @@ -17,7 +17,7 @@ test('checkVersion having require.main.filename', (t) => { fp((fastify, opts, next) => { next() }, { - fastify: '^3.0.0' + fastify: '^4.0.0' }) t.end() @@ -40,7 +40,7 @@ test('checkVersion having no require.main.filename but process.argv[1]', (t) => fp((fastify, opts, next) => { next() }, { - fastify: '^3.0.0' + fastify: '^4.0.0' }) t.end() @@ -66,7 +66,7 @@ test('checkVersion having no require.main.filename and no process.argv[1]', (t) fp((fastify, opts, next) => { next() }, { - fastify: '^3.0.0' + fastify: '^4.0.0' }) t.end() diff --git a/test/test.js b/test/test.js index 2d68d66..fc75588 100644 --- a/test/test.js +++ b/test/test.js @@ -183,12 +183,12 @@ test('should check fastify dependency graph - plugin', t => { const fastify = Fastify() fastify.register(fp((fastify, opts, next) => next(), { - fastify: '3.x', + fastify: '4.x', name: 'plugin1-name' })) fastify.register(fp((fastify, opts, next) => next(), { - fastify: '3.x', + fastify: '4.x', name: 'test', dependencies: ['plugin1-name', 'plugin2-name'] })) @@ -203,12 +203,12 @@ test('should check fastify dependency graph - decorate', t => { const fastify = Fastify() fastify.decorate('plugin1', fp((fastify, opts, next) => next(), { - fastify: '3.x', + fastify: '4.x', name: 'plugin1-name' })) fastify.register(fp((fastify, opts, next) => next(), { - fastify: '3.x', + fastify: '4.x', name: 'test', decorators: { fastify: ['plugin1', 'plugin2'] } })) @@ -223,12 +223,12 @@ test('should check fastify dependency graph - decorateReply', t => { const fastify = Fastify() fastify.decorateReply('plugin1', fp((fastify, opts, next) => next(), { - fastify: '3.x', + fastify: '4.x', name: 'plugin1-name' })) fastify.register(fp((fastify, opts, next) => next(), { - fastify: '3.x', + fastify: '4.x', name: 'test', decorators: { reply: ['plugin1', 'plugin2'] } })) From 64a57b618d12861719fd5e8720bd88beb4257231 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 02:16:52 +0000 Subject: [PATCH 10/13] build(deps-dev): bump @types/node from 17.0.45 to 18.0.0 (#184) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.45 to 18.0.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4de0a1a..5393ea3 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ }, "homepage": "https://github.com/fastify/fastify-plugin#readme", "devDependencies": { - "@types/node": "^17.0.0", + "@types/node": "^18.0.0", "fastify": "^4.0.1", "proxyquire": "^2.1.3", "standard": "^17.0.0", From 31db33fe58a791546dd16cb0fb0b449a8b966f80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 02:27:37 +0000 Subject: [PATCH 11/13] build(deps-dev): bump tsd from 0.20.0 to 0.21.0 (#185) Bumps [tsd](https://github.com/SamVerschueren/tsd) from 0.20.0 to 0.21.0. - [Release notes](https://github.com/SamVerschueren/tsd/releases) - [Commits](https://github.com/SamVerschueren/tsd/compare/v0.20.0...v0.21.0) --- updated-dependencies: - dependency-name: tsd dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5393ea3..0c26d48 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "proxyquire": "^2.1.3", "standard": "^17.0.0", "tap": "^16.0.1", - "tsd": "^0.20.0", + "tsd": "^0.21.0", "typescript": "^4.0.5" }, "dependencies": {} From 61be20de511af93bbbdac7d52f592ef1ef726a28 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jul 2022 02:07:27 +0000 Subject: [PATCH 12/13] build(deps-dev): bump tsd from 0.21.0 to 0.22.0 (#186) Bumps [tsd](https://github.com/SamVerschueren/tsd) from 0.21.0 to 0.22.0. - [Release notes](https://github.com/SamVerschueren/tsd/releases) - [Commits](https://github.com/SamVerschueren/tsd/compare/v0.21.0...v0.22.0) --- updated-dependencies: - dependency-name: tsd dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c26d48..491284b 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "proxyquire": "^2.1.3", "standard": "^17.0.0", "tap": "^16.0.1", - "tsd": "^0.21.0", + "tsd": "^0.22.0", "typescript": "^4.0.5" }, "dependencies": {} From 4b875641416066154ec27793a33ff315c7fd627c Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Mon, 11 Jul 2022 14:18:46 +0200 Subject: [PATCH 13/13] Bumped v4.0.0 Signed-off-by: Matteo Collina --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 491284b..0476dc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fastify-plugin", - "version": "3.0.1", + "version": "4.0.0", "description": "Plugin helper for Fastify", "main": "plugin.js", "types": "plugin.d.ts",