From 8ca7fd4114767e93903b44a737d6d3cfc166a376 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Wed, 24 Mar 2021 10:52:14 +0000 Subject: [PATCH 1/6] chore(package): sort scripts alphabetically ascending --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5e2d283..2f40006 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,12 @@ "description": "Fastify plugin to check environment variables", "main": "index.js", "scripts": { + "coverage": "cross-env VALUE_FROM_ENV=pippo tap --cov --coverage-report=html test/*.js", "lint": "standard | snazzy", "lint:fix": "standard --fix", - "unit": "cross-env VALUE_FROM_ENV=pippo tap test/*.js", "test": "npm run lint && npm run unit && npm run typescript", - "coverage": "cross-env VALUE_FROM_ENV=pippo tap --cov --coverage-report=html test/*.js", - "typescript": "tsd" + "typescript": "tsd", + "unit": "cross-env VALUE_FROM_ENV=pippo tap test/*.js" }, "repository": { "type": "git", From 56c9d4acca961233128dad49bf2b617ecb1962cd Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Wed, 24 Mar 2021 10:58:18 +0000 Subject: [PATCH 2/6] ci: ignore documentation updates --- .github/workflows/ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9e6ab0..628373e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,15 @@ name: CI workflow -on: [push, pull_request] + +on: + push: + paths-ignore: + - 'docs/**' + - '*.md' + pull_request: + paths-ignore: + - 'docs/**' + - '*.md' + jobs: test: runs-on: ubuntu-latest From e990dfd20276c43e957d1ae41bf623e4210e8fa8 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Wed, 24 Mar 2021 10:58:31 +0000 Subject: [PATCH 3/6] ci: test on multiple os --- .github/workflows/ci.yml | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 628373e..b21c6ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CI workflow +name: CI on: push: @@ -12,26 +12,37 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: matrix: node-version: [10.x, 12.x, 14.x] + os: [macos-latest, ubuntu-latest, windows-latest] + steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2.1.5 - with: - node-version: ${{ matrix.node-version }} - - name: Install Dependencies - run: npm install --ignore-scripts - - name: Test - run: npm test + - uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v2.1.5 + with: + node-version: ${{ matrix.node-version }} + + - name: Install Dependencies + run: | + npm install --ignore-scripts + + - name: Lint + run: | + npm run lint:ci + + - name: Run Tests + run: | + npm run test automerge: needs: test runs-on: ubuntu-latest steps: - uses: fastify/github-action-merge-dependabot@v2.0.0 - if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }} with: - github-token: ${{secrets.github_token}} + github-token: ${{ secrets.GITHUB_TOKEN }} From d6e1bfe1a39b30c5cdbd1f7275774f4df4a521b5 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Wed, 24 Mar 2021 10:58:47 +0000 Subject: [PATCH 4/6] docs(readme): add badges --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 265cd6a..69fdd27 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # fastify-env -![CI workflow](https://github.com/fastify/fastify-env/workflows/CI%20workflow/badge.svg) -[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) + +![CI](https://github.com/fastify/fastify-env/workflows/CI/badge.svg) +[![NPM version](https://img.shields.io/npm/v/fastify-env.svg?style=flat)](https://www.npmjs.com/package/fastify-env) +[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-env/badge.svg)](https://snyk.io/test/github/fastify/fastify-env) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/) Fastify plugin to check environment variables From 84d35938c317be4538ba4275bcbf830717db9c9e Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Wed, 24 Mar 2021 11:01:58 +0000 Subject: [PATCH 5/6] docs(readme): grammar and spelling fixes --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 69fdd27..5521e03 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,8 @@ fastify }) ``` -This module is a wrapper around [env-schema](https://www.npmjs.com/package/env-schema) so, to read `.env` file you must set the `dotenv` in options: +This module is a wrapper around [env-schema](https://www.npmjs.com/package/env-schema). +To read an `.env` file you must set `dotenv` in the options: ```js const options = { @@ -63,10 +64,10 @@ const options = { ``` -**NB:** internally this plugin force to not have additional properties, so the `additionalProperties` flag is forced to be `false` +**NB:** support for additional properties in the schema is disabled for this plugin, with the `additionalProperties` flag set to `false` internally. ### Typescript -In order to have typing for the fastify instance, you should follow the example below. +In order to have typing for the fastify instance, you should follow the example below: ```typescript declare module 'fastify' { From 88e90d8cc885abef811e8d61cb95dd67a052a1d6 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Wed, 24 Mar 2021 11:46:22 +0000 Subject: [PATCH 6/6] chore(ci): correct lint script used --- .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 b21c6ca..9f7e750 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - name: Lint run: | - npm run lint:ci + npm run lint - name: Run Tests run: |