From 01ad896154b3133e4820c6c012d6c9ba14cfd5c5 Mon Sep 17 00:00:00 2001 From: Uzlopak Date: Mon, 14 Aug 2023 09:45:22 +0200 Subject: [PATCH 1/3] chore: remove express (#227) --- README.md | 19 ---------------- boot.js | 7 ------ package.json | 1 - test/express.test.js | 52 -------------------------------------------- 4 files changed, 79 deletions(-) delete mode 100644 test/express.test.js diff --git a/README.md b/README.md index 41b34cb..80e04e7 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,6 @@ async function third (instance, opts) { * instance.override() * instance.onClose() * instance.close() - * avvio.express() * avvio.toJSON() * avvio.prettyPrint() @@ -444,24 +443,6 @@ also start the boot sequence. Start the boot sequence, if it was not started yet. Returns the `app` instance. -------------------------------------------------------- - - -### avvio.express(app) - -Same as: - -```js -const app = express() -const avvio = require('avvio') - -avvio(app, { - expose: { - use: 'load' - } -}) -``` - ------------------------------------------------------- diff --git a/boot.js b/boot.js index 5c1001c..bc2716f 100644 --- a/boot.js +++ b/boot.js @@ -632,10 +632,3 @@ function encapsulateThreeParam (func, that) { } module.exports = Boot -module.exports.express = function (app) { - return Boot(app, { - expose: { - use: 'load' - } - }) -} diff --git a/package.json b/package.json index afb18d0..29a724a 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "devDependencies": { "@fastify/pre-commit": "^2.0.2", "@types/node": "^20.1.0", - "express": "^4.17.1", "standard": "^17.0.0", "tap": "^16.0.0", "typescript": "^5.0.2" diff --git a/test/express.test.js b/test/express.test.js deleted file mode 100644 index eb223cd..0000000 --- a/test/express.test.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict' - -const { test } = require('tap') -const express = require('express') -const http = require('http') -const boot = require('..') - -test('express support', (t) => { - const app = express() - - boot.express(app) - // It does: - // - // boot(app, { - // expose: { - // use: 'load' - // } - // }) - - t.plan(2) - - let loaded = false - let server - - app.load(function (app, opts, done) { - loaded = true - app.use(function (req, res) { - res.end('hello world') - }) - - done() - }) - - app.after((cb) => { - t.ok(loaded, 'plugin loaded') - server = app.listen(0, cb) - t.teardown(server.close.bind(server)) - }) - - app.ready(() => { - http.get(`http://localhost:${server.address().port}`).on('response', function (res) { - let data = '' - res.on('data', function (chunk) { - data += chunk - }) - - res.on('end', function () { - t.equal(data, 'hello world') - }) - }) - }) -}) From 9801fc380f7dba9bf7d3fe8b7f7ab37ac60f787c Mon Sep 17 00:00:00 2001 From: Nicholas Rayburn <52075362+nrayburn-tech@users.noreply.github.com> Date: Thu, 28 Mar 2024 12:33:33 -0500 Subject: [PATCH 2/3] Feat/updates for v5 (#246) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Sync gitignore with fastify/skeleton * Update workflows for fastify v5 * Update all dependencies * merge --------- Signed-off-by: Gürgün Dayıoğlu Co-authored-by: Gürgün Dayıoğlu --- .github/workflows/ci.yml | 2 +- .gitignore | 10 +++++----- .taprc | 7 ++----- package.json | 12 ++++++------ 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0610c55..582175c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ on: jobs: test: - uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3 + uses: fastify/workflows/.github/workflows/plugins-ci.yml@v4.1.0 with: lint: true license-check: true diff --git a/.gitignore b/.gitignore index 2b6aed4..143b73f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,9 @@ lerna-debug.log* # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +# Clinic +.clinic + # Runtime data pids *.pid @@ -135,18 +138,15 @@ dist # macOS files .DS_Store -# Clinic -.clinic - # lock files -bun.lockb package-lock.json pnpm-lock.yaml yarn.lock +bun.lockb # editor files .vscode .idea -#tap files +# tap files .tap/ diff --git a/.taprc b/.taprc index 3e0ad3a..2fa6a86 100644 --- a/.taprc +++ b/.taprc @@ -1,7 +1,4 @@ -ts: false -jsx: false -flow: false -check-coverage: false +disable-coverage: true files: - - test/**/*test.js \ No newline at end of file + - test/**/*test.js diff --git a/package.json b/package.json index 1328d21..7454240 100644 --- a/package.json +++ b/package.json @@ -38,14 +38,14 @@ }, "homepage": "https://github.com/fastify/avvio#readme", "devDependencies": { - "@fastify/pre-commit": "^2.0.2", - "@types/node": "^20.1.0", - "standard": "^17.0.0", - "tap": "^16.0.0", - "typescript": "^5.0.2" + "@fastify/pre-commit": "^2.1.0", + "@types/node": "^20.11.29", + "standard": "^17.1.0", + "tap": "^18.7.1", + "typescript": "^5.4.2" }, "dependencies": { - "@fastify/error": "^3.3.0", + "@fastify/error": "^3.4.1", "fastq": "^1.17.1" } } From 8e4502b2a88d78b298d966c7ad72741dc1e404f8 Mon Sep 17 00:00:00 2001 From: James Sumners Date: Sat, 13 Jul 2024 07:45:08 -0400 Subject: [PATCH 3/3] update fastify deps --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 33fd45e..82877d6 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "typescript": "^5.4.2" }, "dependencies": { - "@fastify/error": "^3.4.1", + "@fastify/error": "^4.0.0", "fastq": "^1.17.1" } }