Skip to content

Commit

Permalink
Update and remove deps, github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarlium committed Aug 29, 2024
1 parent c225a04 commit 5e38e77
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 19 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Node.js CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: TZ=Europe/Oslo npm test
10 changes: 10 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"pkgFiles": ["package.json", "package-lock.json"],
"git": {
"requireCleanWorkingDir": true,
"changelog": "auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs"
},
"hooks": {
"after:bump": "auto-changelog -p"
}
}
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use strict';
const Hoek = require('@hapi/hoek');

function register(server, options) {
Hoek.assert(typeof options.headers === 'object', 'Option headers must be an object');
if (typeof options.headers !== 'object') {
throw new Error('Option headers must be an object');
}

server.ext('onPreResponse', (request) => {
Object.keys(options.headers).forEach((key) => {
Expand Down
25 changes: 11 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
"description": "Plugin for adding a defined set of headers to append to all responses.",
"main": "index.js",
"scripts": {
"lint": "eslint --ext '.js' lib test *.js",
"lint": "eslint --ext '.js' index.js test *.js",
"watch": "mocha --watch 'test/**/*.js' 'index.js' --timeout 500",
"test": "npm run lint && nyc --reporter=text-summary --reporter=lcov mocha --exit 'test/**/*.test.js'",
"mocha-only-detect": "mocha-only-detector-glob **/*.test.js",
"changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:\" * %s\"",
"release": "npm test && release-it -n -i patch",
"release:minor": "npm test && release-it -n -i minor",
"release:major": "npm test && release-it -n -i major"
Expand All @@ -33,25 +32,23 @@
"eslintConfig": {
"extends": "@aptoma/eslint-config",
"parserOptions": {
"ecmaVersion": "2017"
"ecmaVersion": 10
},
"env": {
"node": true,
"mocha": true,
"es6": true
}
},
"dependencies": {
"@hapi/hoek": "^8.0.2"
},
"devDependencies": {
"@aptoma/eslint-config": "^7.0.1",
"@hapi/hapi": "^18.3.1",
"chai": "^4.1.2",
"eslint": "^4.12.1",
"mocha": "^4.0.1",
"mocha-only-detector": "^0.1.0",
"nyc": "^14.1.1",
"release-it": "^2.3.1"
"@aptoma/eslint-config": "^8.0.0",
"@hapi/boom": "^10.0.1",
"@hapi/hapi": "^21.3.10",
"chai": "^4.5.0",
"eslint": "^8.57.0",
"mocha": "^10.7.3",
"mocha-only-detector": "^1.0.1",
"nyc": "^17.0.0",
"release-it": "^17.6.0"
}
}

0 comments on commit 5e38e77

Please sign in to comment.