diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..a0e7df9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Set default behavior to automatically convert line endings +* text=auto eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 079a8f0..49cf6cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,11 @@ name: CI on: push: + branches: + - main + - master + - next + - 'v*' paths-ignore: - 'docs/**' - '*.md' @@ -12,7 +17,8 @@ on: jobs: test: - uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3 + uses: fastify/workflows/.github/workflows/plugins-ci.yml@v5.0.0 with: - license-check: true lint: true + license-check: true + node-versions: '["16", "18", "20", "22"]' diff --git a/.gitignore b/.gitignore index 3c21249..2b6aed4 100644 --- a/.gitignore +++ b/.gitignore @@ -147,3 +147,6 @@ yarn.lock # editor files .vscode .idea + +#tap files +.tap/ diff --git a/README.md b/README.md index 911f7e0..a29ab65 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Build and manage the [`fast-json-stringify`](https://www.npmjs.com/package/fast- This package is responsible for compiling the application's `response` JSON schemas into optimized functions to speed up the response time. [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) -[![Continuous Integration](https://github.com/fastify/fast-json-stringify-compiler/workflows/Continuous%20Integration/badge.svg)](https://github.com/fastify/fast-json-stringify-compiler/actions/workflows/ci.yml) +[![CI](https://github.com/fastify/fast-json-stringify-compiler/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fastify/fast-json-stringify-compiler/actions/workflows/ci.yml) ## Versions @@ -19,12 +19,12 @@ This package is responsible for compiling the application's `response` JSON sche The `fast-json-stringify` configuration is the default one. You can check it the default settings in the [`fast-json-stringify` option](https://github.com/fastify/fast-json-stringify/#options) documentation. -You can also override the default configuration by passing the [`serializerOpts`](https://www.fastify.io/docs/latest/Reference/Server/#serializeropts) configuration to the Fastify instance. +You can also override the default configuration by passing the [`serializerOpts`](https://fastify.dev/docs/latest/Reference/Server/#serializeropts) configuration to the Fastify instance. ## Usage This module is already used as default by Fastify. -If you need to provide to your server instance a different version, refer to [the official doc](https://www.fastify.io/docs/latest/Reference/Server/#schemacontroller). +If you need to provide to your server instance a different version, refer to [the official doc](https://fastify.dev/docs/latest/Reference/Server/#schemacontroller). ### fast-json-stringify Standalone @@ -120,7 +120,7 @@ app.listen({ port: 3000 }) ### How it works -This module provide a factory function to produce [Serializer Compilers](https://www.fastify.io/docs/latest/Reference/Server/#serializercompiler) functions. +This module provide a factory function to produce [Serializer Compilers](https://fastify.dev/docs/latest/Reference/Server/#serializercompiler) functions. ## License diff --git a/package.json b/package.json index c9511bd..5543077 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "@fastify/fast-json-stringify-compiler", "description": "Build and manage the fast-json-stringify instances for the fastify framework", - "version": "4.3.0", + "version": "5.0.0", "main": "index.js", + "type": "commonjs", "types": "types/index.d.ts", "scripts": { "lint": "standard", @@ -23,18 +24,18 @@ }, "homepage": "https://github.com/fastify/fast-json-stringify-compiler#readme", "devDependencies": { - "@fastify/pre-commit": "^2.0.2", - "fastify": "^4.0.0", + "@fastify/pre-commit": "^2.1.0", + "fastify": "^5.0.0-alpha.4", "sanitize-filename": "^1.6.3", - "standard": "^17.0.0", - "tap": "^16.0.0", - "tsd": "^0.28.0" + "standard": "^17.1.0", + "tap": "^18.7.2", + "tsd": "^0.31.0" }, "pre-commit": [ "lint", "test" ], "dependencies": { - "fast-json-stringify": "^5.7.0" + "fast-json-stringify": "^6.0.0" } } diff --git a/test/standalone.test.js b/test/standalone.test.js index 51f773c..d8c5162 100644 --- a/test/standalone.test.js +++ b/test/standalone.test.js @@ -1,7 +1,7 @@ 'use strict' -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const t = require('tap') const fastify = require('fastify') const sanitize = require('sanitize-filename')