Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

feat!: migrate to fastify org #1

Merged
merged 23 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 10

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
32 changes: 16 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: CI workflow
on: [push, pull_request]
name: CI

on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 13.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install --ignore-scripts
- name: Test
run: npm test
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3
with:
lint: true
license-check: true
95 changes: 88 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ logs
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

# Runtime data
pids
Expand All @@ -16,11 +21,12 @@ lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
Expand All @@ -36,15 +42,27 @@ build/Release
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

Expand All @@ -54,12 +72,75 @@ typings/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# next.js build output
# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# npm
# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Vim swap files
*.swp

# macOS files
.DS_Store

# lock files
package-lock.json
yarn.lock
pnpm-lock.yaml
yarn.lock

# editor files
.vscode
.idea
Footer
4 changes: 0 additions & 4 deletions .npmignore

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
6 changes: 4 additions & 2 deletions .taprc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
esm: false
ts: false
jsx: false
coverage: true
flow: true
flow: true

files:
- test/**/*.test.js
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Fastify Early Hints
# @fastify/early-hints


[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
![Continuous
Integration](https://github.com/zekth/fastify-early-hints/workflows/CI%20workflow/badge.svg)
Integration](https://github.com/fastify/fastify-early-hints/workflows/CI%20workflow/badge.svg)

Draft proposal of plugin handling the HTTP 103 code.
Based on : https://github.com/fastify/fastify/issues/2683

## Install
```
npm i fastify-early-hints
npm i @fastify/early-hints
```

## Usage
Expand All @@ -19,7 +19,7 @@ npm i fastify-early-hints

```javascript
const Fastify = require("fastify");
const eh = require("fastify-early-hints");
const eh = require("@fastify/early-hints");

const fastify = Fastify({ logger: true });
fastify.register(eh);
Expand All @@ -41,7 +41,7 @@ fastify.get("/", async (request, reply) => {

const start = async () => {
try {
await fastify.listen(3000);
await fastify.listen({ port: 3000 });
fastify.log.info(`server listening on ${fastify.server.address().port}`);
} catch (err) {
fastify.log.error(err);
Expand Down Expand Up @@ -88,4 +88,4 @@ Connection: keep-alive

## License

Licensed under [MIT](./LICENSE).<br/>
Licensed under [MIT](./LICENSE).
9 changes: 9 additions & 0 deletions benchmark/formatEntry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict'

const benchmark = require('benchmark')
const formatEntry = require('../lib/formatEntry')

new benchmark.Suite()
.add('formatEntry', function () { formatEntry({ href: '/', rel: 'preconnect', cors: 'anonymous', as: 'script' }) }, { minSamples: 100 })
.on('cycle', function onCycle (event) { console.log(String(event.target)) })
.run()
20 changes: 0 additions & 20 deletions index.d.ts

This file was deleted.

Loading