Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop node 8 support #180

Open
wants to merge 157 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
db2a88b
build(*): Add/Move build tooling config
Apr 11, 2021
40b34cf
build(cloudfront): Prettier formatting
Apr 11, 2021
a5e32b0
build(semantic-release): Add release config
Apr 11, 2021
1c1689e
build(github): Improve CD workflows
nhammond101 Feb 15, 2023
704288a
chore(*): Drop node 8 support
Apr 11, 2021
426dd07
docs: Demonstrate ES6 usage
Apr 11, 2021
364c589
chore(deps): update dependency eslint to v7.24.0
renovate-bot Apr 11, 2021
2e56829
chore(deps): update typescript-eslint monorepo to v4.21.0
renovate-bot Apr 11, 2021
92b2d2c
chore(deps): update dependency eslint-plugin-jest to v24.3.5
renovate-bot Apr 11, 2021
15769c2
2.0.0
Apr 12, 2021
fe7d556
chore(deps): update typescript-eslint monorepo to v4.22.0
renovate-bot Apr 12, 2021
f7ad218
chore(deps): update dependency @types/node to v12.20.8
renovate-bot Apr 14, 2021
5ff10bc
chore(deps): update dependency @types/node to v12.20.9
renovate-bot Apr 15, 2021
5fe8e78
chore(deps): update dependency ts-jest to v26.5.5
renovate-bot Apr 15, 2021
4260ad5
chore(deps): update dependency @types/node to v12.20.10
renovate-bot Apr 16, 2021
979aa8d
fix(deps): update dependency chalk to v4.1.1
renovate-bot Apr 21, 2021
b6bc519
chore(deps): update dependency eslint to v7.25.0
renovate-bot Apr 23, 2021
ba1fdf5
chore(deps): update dependency eslint-plugin-jest to v24.3.6
renovate-bot Apr 26, 2021
dcdd190
chore(deps): update dependency @types/jest to v26.0.23
renovate-bot Apr 26, 2021
ff77433
chore(deps): update dependency @types/node to v12.20.11
renovate-bot Apr 27, 2021
076af03
chore(deps): update typescript-eslint monorepo to v4.22.1
renovate-bot May 4, 2021
22deb7d
chore(deps): update dependency @types/node to v12.20.12
renovate-bot May 5, 2021
5ab4945
chore(deps): update dependency ts-jest to v26.5.6
renovate-bot May 5, 2021
e57363a
chore(deps): update dependency eslint to v7.26.0
renovate-bot May 8, 2021
2356604
chore(deps): update dependency prettier to v2.3.0
renovate-bot May 10, 2021
4bbcfc7
chore(deps): update typescript-eslint monorepo to v4.23.0
renovate-bot May 10, 2021
9356ee1
chore(deps): update dependency hosted-git-info to 2.8.9 [security]
renovate-bot May 8, 2021
1e9cc05
chore(deps): update dependency @types/node to v12.20.13
renovate-bot May 12, 2021
1e019a3
chore(deps): update dependency semantic-release to v17.4.3
renovate-bot May 13, 2021
6215e3f
chore(deps): update typescript-eslint monorepo to v4.24.0
renovate-bot May 17, 2021
519d707
chore(deps): update dependency eslint to v7.27.0
renovate-bot May 22, 2021
f09b564
chore(deps): update typescript-eslint monorepo to v4.25.0
renovate-bot May 24, 2021
b46cee3
chore(deps): update dependency @types/express to v4.17.12
renovate-bot May 25, 2021
9ba4b37
chore(deps): update dependency jest-junit to v12.1.0
renovate-bot May 25, 2021
2685d97
chore(deps): update dependency typescript to v4.3.2
renovate-bot May 26, 2021
f610693
chore(deps): update typescript-eslint monorepo to v4.26.0
renovate-bot May 31, 2021
585c845
chore(deps): update dependency @types/node to v14
renovate-bot May 31, 2021
e60e41d
chore(deps): update dependency ts-jest to v27
renovate-bot May 31, 2021
155495d
chore(deps): update jest monorepo
renovate-bot May 29, 2021
82d295b
chore(deps): update dependency @types/node to v14.17.2
renovate-bot Jun 2, 2021
941548d
chore(deps): update dependency jest to v27.0.4
renovate-bot Jun 3, 2021
742e111
chore(deps): update dependency eslint to v7.28.0
renovate-bot Jun 4, 2021
c8bfac1
chore(deps): update dependency prettier to v2.3.1
renovate-bot Jun 5, 2021
ae04dc7
chore(deps): update dependency ts-jest to v27.0.3
renovate-bot Jun 6, 2021
ba2a006
chore(deps): update typescript-eslint monorepo to v4.26.1
renovate-bot Jun 7, 2021
3eee945
chore(deps): update dependency @types/node to v14.17.3
renovate-bot Jun 7, 2021
ee4ea15
chore(deps): update dependency jest-junit to v12.2.0
renovate-bot Jun 9, 2021
ce52692
chore(deps): update typescript-eslint monorepo to v4.27.0
renovate-bot Jun 14, 2021
e28a50e
chore(deps): update dependency semantic-release to v17.4.4
renovate-bot Jun 15, 2021
fa17e8c
chore(deps): update dependency typescript to v4.3.3
renovate-bot Jun 17, 2021
5954fb2
chore(deps): update dependency typescript to v4.3.4
renovate-bot Jun 17, 2021
c61122c
chore(deps): update dependency eslint to v7.29.0
renovate-bot Jun 18, 2021
bd41a95
chore(deps): update typescript-eslint monorepo to v4.28.0
renovate-bot Jun 21, 2021
7e91146
chore(deps): update dependency jest to v27.0.5
renovate-bot Jun 22, 2021
a592075
chore(deps): update dependency @types/node to v14.17.4
renovate-bot Jun 23, 2021
40682aa
chore(deps): update dependency prettier to v2.3.2
renovate-bot Jun 26, 2021
0f6c4c0
chore(deps): update jest monorepo to v27.0.6
renovate-bot Jun 28, 2021
ee6628d
chore(deps): update typescript-eslint monorepo to v4.28.1
renovate-bot Jun 28, 2021
43339f6
chore(deps): update dependency typescript to v4.3.5
renovate-bot Jul 1, 2021
4b85732
chore(deps): update dependency @types/debug to v4.1.6
renovate-bot Jul 1, 2021
4cf9aaa
chore(deps): update dependency eslint to v7.30.0
renovate-bot Jul 2, 2021
eeba573
fix(deps): update dependency debug to v4.3.2
renovate-bot Jul 4, 2021
6069f78
chore(deps): update typescript-eslint monorepo to v4.28.2
renovate-bot Jul 5, 2021
cac9135
chore(deps): update dependency @types/express to v4.17.13
renovate-bot Jul 6, 2021
3506ad0
chore(deps): update dependency @types/jest to v26.0.24
renovate-bot Jul 6, 2021
4f4cbb1
chore(deps): update dependency @types/node to v14.17.5
renovate-bot Jul 7, 2021
e0eb8e4
chore(deps): update typescript-eslint monorepo to v4.28.3
renovate-bot Jul 12, 2021
c59a642
chore(deps): update dependency eslint to v7.31.0
renovate-bot Jul 17, 2021
3324ebc
chore(deps): update typescript-eslint monorepo to v4.28.4
renovate-bot Jul 19, 2021
b41c705
chore(deps): update dependency eslint-plugin-jest to v24.3.7
renovate-bot Jul 21, 2021
424c9ed
chore(deps): update dependency ts-jest to v27.0.4
renovate-bot Jul 21, 2021
2f7d034
chore(deps): update dependency eslint-plugin-jest to v24.4.0
renovate-bot Jul 21, 2021
8f95b01
chore(deps): update dependency @types/debug to v4.1.7
renovate-bot Jul 24, 2021
83fd4b3
chore(deps): update dependency @types/node to v14.17.6
renovate-bot Jul 24, 2021
a6e75ca
chore(deps): update typescript-eslint monorepo to v4.28.5
renovate-bot Jul 26, 2021
37ed375
fix(deps): update dependency chalk to v4.1.2
renovate-bot Jul 30, 2021
66e0f99
chore(deps): update dependency eslint to v7.32.0
renovate-bot Jul 31, 2021
75f4b76
chore(deps): update dependency @types/node to v14.17.7
renovate-bot Aug 1, 2021
c0a6b43
chore(deps): update typescript-eslint monorepo to v4.29.0
renovate-bot Aug 2, 2021
9ca1972
chore(deps): update dependency @types/node to v14.17.9
renovate-bot Aug 4, 2021
d4680cb
chore(deps): update typescript-eslint monorepo to v4.29.1
renovate-bot Aug 9, 2021
1ccb569
chore(deps): update dependency semantic-release to v17.4.5
renovate-bot Aug 16, 2021
1d8084f
chore(deps): update typescript-eslint monorepo to v4.29.2
renovate-bot Aug 16, 2021
d85a900
chore(deps): update dependency ts-jest to v27.0.5
renovate-bot Aug 17, 2021
b490b3a
chore(deps): update dependency @types/node to v14.17.10
renovate-bot Aug 18, 2021
00e61d5
chore(deps): update dependency @types/node to v14.17.11
renovate-bot Aug 21, 2021
56c1435
chore(deps): update typescript-eslint monorepo to v4.29.3
renovate-bot Aug 23, 2021
5647223
chore(deps): update dependency semantic-release to v17.4.6
renovate-bot Aug 23, 2021
ac802b1
chore(deps): update dependency @types/jest to v27
renovate-bot Aug 21, 2021
daa3bd2
chore(deps): update dependency path-parse to 1.0.7 [security]
renovate-bot Aug 11, 2021
27a8dcf
chore(deps): update dependency semantic-release to v17.4.7
renovate-bot Aug 25, 2021
8d49025
chore(deps): update dependency @types/node to v14.17.12
renovate-bot Aug 26, 2021
34d5d7e
chore(deps): update dependency typescript to v4.4.2
renovate-bot Aug 26, 2021
96eed5d
chore(deps): update jest monorepo to v27.1.0
renovate-bot Aug 27, 2021
3ef7364
chore(deps): update typescript-eslint monorepo to v4.30.0
renovate-bot Aug 30, 2021
5b2fd8d
chore(deps): update dependency @types/node to v14.17.13
renovate-bot Aug 31, 2021
76109cd
chore(deps): update dependency @types/node to v14.17.14
renovate-bot Aug 31, 2021
c3fa58f
chore(deps): update typescript-eslint monorepo to v4.31.0
renovate-bot Sep 6, 2021
d63849d
chore(deps): update dependency @types/node to v14.17.15
renovate-bot Sep 7, 2021
dbfb471
chore(deps): update jest monorepo to v27.1.1
renovate-bot Sep 8, 2021
bd0bcad
chore(deps): update dependency prettier to v2.4.0
renovate-bot Sep 9, 2021
bdb215c
chore(deps): update dependency typescript to v4.4.3
renovate-bot Sep 10, 2021
340b2bc
chore(deps): update typescript-eslint monorepo to v4.31.1
renovate-bot Sep 13, 2021
91e4100
chore(deps): update dependency eslint-import-resolver-typescript to v…
renovate-bot Sep 13, 2021
63e0284
chore(deps): update jest monorepo to v27.2.0
renovate-bot Sep 13, 2021
e998334
chore(deps): update dependency @types/node to v14.17.16
renovate-bot Sep 14, 2021
8615592
chore(deps): update dependency prettier to v2.4.1
renovate-bot Sep 16, 2021
0cb865f
chore(deps): update dependency @types/node to v14.17.17
renovate-bot Sep 16, 2021
ea43994
chore(deps): update dependency eslint-plugin-jest to v24.4.2
renovate-bot Sep 17, 2021
d8fb73e
chore(deps): update dependency semantic-release to v18
renovate-bot Sep 17, 2021
a7a57c3
chore(deps): update dependency jest to v27.2.1
renovate-bot Sep 20, 2021
81cb9ce
chore(deps): update typescript-eslint monorepo to v4.31.2
renovate-bot Sep 20, 2021
39e74f4
chore(deps): update dependency @types/jest to v27.0.2
renovate-bot Sep 21, 2021
48b1b04
chore(deps): update dependency semver-regex to 3.1.3 [security]
renovate-bot Sep 21, 2021
6930e30
chore(deps): update dependency @types/node to v14.17.18
renovate-bot Sep 21, 2021
7b3a772
chore(deps): update dependency jest-junit to v12.3.0
renovate-bot Sep 21, 2021
c90a42c
chore(deps): update dependency @types/node to v14.17.19
renovate-bot Sep 25, 2021
f36247c
chore(deps): update jest monorepo to v27.2.2
renovate-bot Sep 25, 2021
1bc5338
chore(deps): update typescript-eslint monorepo to v4.32.0
renovate-bot Sep 27, 2021
224ef1f
chore(deps): update jest monorepo to v27.2.3
renovate-bot Sep 28, 2021
fc3c10a
chore(deps): update dependency eslint-plugin-jest to v24.4.3
renovate-bot Sep 28, 2021
c407000
chore(deps): update dependency @types/node to v14.17.20
renovate-bot Sep 29, 2021
c0575db
chore(deps): update jest monorepo to v27.2.4
renovate-bot Sep 29, 2021
807992e
chore(deps): update dependency eslint-plugin-jest to v24.5.0
renovate-bot Sep 29, 2021
1d75d11
chore(deps): update dependency eslint-plugin-jest to v24.5.2
renovate-bot Oct 4, 2021
d98abb9
chore(deps): update typescript-eslint monorepo to v4.33.0
renovate-bot Oct 4, 2021
e89c255
chore(deps): update dependency jest-junit to v13
renovate-bot Oct 4, 2021
3dd7170
chore(deps): update dependency @types/node to v14.17.21
renovate-bot Oct 5, 2021
04aee9a
chore(deps): update jest monorepo to v27.2.5
renovate-bot Oct 8, 2021
1c2ca37
chore(deps): update dependency eslint-plugin-jest to v24.6.0
renovate-bot Oct 9, 2021
694157e
chore(deps): update dependency eslint-plugin-jest to v24.7.0
renovate-bot Oct 10, 2021
3e19b3b
chore(deps): update dependency @types/node to v14.17.22
renovate-bot Oct 12, 2021
59a7452
chore(deps): update dependency typescript to v4.4.4
renovate-bot Oct 12, 2021
f62248f
chore(deps): update dependency @types/node to v14.17.25
renovate-bot Oct 13, 2021
841b7ce
chore(deps): update dependency @types/node to v14.17.26
renovate-bot Oct 13, 2021
57daedf
chore(deps): update dependency @types/node to v14.17.27
renovate-bot Oct 14, 2021
4db5bb0
chore(deps): update dependency ts-jest to v27.0.6
renovate-bot Oct 14, 2021
8e97b4d
chore(deps): update dependency ts-jest to v27.0.7
renovate-bot Oct 16, 2021
4f7f709
chore(deps): update jest monorepo to v27.3.0
renovate-bot Oct 19, 2021
4e8a412
chore(deps): update jest monorepo to v27.3.1
renovate-bot Oct 19, 2021
ca165b4
chore(deps): update dependency @types/node to v14.17.29
renovate-bot Oct 22, 2021
b2fd259
chore(deps): update dependency @types/node to v14.17.31
renovate-bot Oct 25, 2021
4584cbd
chore(deps): update dependency @types/node to v14.17.32
renovate-bot Oct 26, 2021
bef3647
chore(deps): update dependency @types/node to v14.17.33
renovate-bot Nov 8, 2021
de6fbf9
chore(deps): update dependency typescript to v4.5.2
renovate-bot Nov 17, 2021
8c9ee0d
chore(deps): update dependency @types/node to v14.17.34
renovate-bot Nov 18, 2021
d4624c2
chore(deps): update dependency semantic-release to v18.0.1
renovate-bot Nov 24, 2021
a5d013c
chore(deps): update dependency @types/jest to v27.0.3
renovate-bot Nov 24, 2021
cd44856
chore(deps): update dependency prettier to v2.5.0
renovate-bot Nov 25, 2021
0b500a4
fix(deps): update dependency debug to v4.3.3
renovate-bot Nov 27, 2021
5f8d8fa
chore(deps): update dependency minimist to 1.2.6 [security]
renovate-bot Mar 26, 2022
72a2942
chore(deps): bump versions
nhammond101 Feb 15, 2023
577449a
chore(release): 2.0.0 [skip ci]
semantic-release-bot Feb 15, 2023
9ca784d
fix(deps): bump express dependencies
nhammond101 Feb 15, 2023
6d37584
chore(release): 2.0.0 [skip ci]
semantic-release-bot Feb 15, 2023
73562a8
docs: reset readme
nhammond101 Feb 15, 2023
07ec6d5
chore(release): 2.0.0 [skip ci]
semantic-release-bot Feb 15, 2023
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
27 changes: 6 additions & 21 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
Expand All @@ -9,9 +10,6 @@
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

Expand Down Expand Up @@ -62,9 +60,6 @@ atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
Expand All @@ -85,7 +80,6 @@ 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
Expand Down Expand Up @@ -134,9 +128,6 @@ web_modules/
# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
Expand All @@ -152,12 +143,9 @@ web_modules/
# Yarn Integrity file
.yarn-integrity

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

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand All @@ -180,12 +168,6 @@ dist
# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

Expand All @@ -208,6 +190,9 @@ dist
.yarn/install-state.gz
.pnp.*

## Custom project exclusions
*.js
!src/*

.eslintrc.js

6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build
on:
pull_request:
branches:
- main
- next

jobs:

Expand All @@ -16,14 +16,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
# The Node.js version to configure
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint:all
run: npm run lint
- name: Test
run: npm test
- name: Build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ on:
push:
branches:
- 'main'
- 'next'

jobs:

build:
name: Test and Build and Release new candidate
bump-version:
name: Version increment
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -18,13 +19,9 @@ jobs:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint:all
- name: Test
run: npm test
- name: Build
run: npm run build
- name: Semantic Release
- name: Release
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
7 changes: 7 additions & 0 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"hooks": {
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
"pre-commit": "npm run format -- --fix && npm run lint",
"pre-push":"npm test && npm run build"
}
}
4 changes: 1 addition & 3 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"*ts": [
"npm run lint -- --fix --"
]
"*ts": ["npm run lint -- --fix --"]
}
18 changes: 13 additions & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
coverage
dist
gen
node_modules
test-reports
# Created by .ignore support plugin (hsz.mobi)
**/tests/fixtures/**/*
**/tests/fixture-project/**/*
**/dist
**/coverage
**/shared-fixtures
**/.vscode
**/.nyc_output
**/.vs
.github

# Ignore CHANGELOG.md files to avoid issues with automated release job
CHANGELOG.md
15 changes: 15 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"endOfLine": "lf",
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# [2.0.0](https://github.com/nhammond101/cloudfront-ip-ranges/compare/v1.0.1...v2.0.0) (2023-02-15)


### Bug Fixes

* **deps:** bump express dependencies ([9ca784d](https://github.com/nhammond101/cloudfront-ip-ranges/commit/9ca784dcd1e428e862a8a03632c867cd2402f8c3))
* **deps:** update dependency chalk to v4.1.1 ([979aa8d](https://github.com/nhammond101/cloudfront-ip-ranges/commit/979aa8ded650f3026a0f6728de3a31d432654798))
* **deps:** update dependency chalk to v4.1.1 ([b7fba7d](https://github.com/nhammond101/cloudfront-ip-ranges/commit/b7fba7d820930b8356f9220d1341111beffa10d9))
* **deps:** update dependency chalk to v4.1.2 ([37ed375](https://github.com/nhammond101/cloudfront-ip-ranges/commit/37ed3751de2087412cd7397c63d9dacf373f60a1))
* **deps:** update dependency chalk to v4.1.2 ([61f9416](https://github.com/nhammond101/cloudfront-ip-ranges/commit/61f9416dc67d30f5d80ba4a511619529ee0a77af))
* **deps:** update dependency debug to v4.3.2 ([eeba573](https://github.com/nhammond101/cloudfront-ip-ranges/commit/eeba573081258eb6c5444c5cb05731dba506567f))
* **deps:** update dependency debug to v4.3.2 ([cd22e4a](https://github.com/nhammond101/cloudfront-ip-ranges/commit/cd22e4a4826c663e92645d7f0e14791f922a8588))
* **deps:** update dependency debug to v4.3.3 ([0b500a4](https://github.com/nhammond101/cloudfront-ip-ranges/commit/0b500a4f3f21909c0ca7bf0673f6f4f66ff542d2))
* **deps:** update dependency debug to v4.3.3 ([3f28f86](https://github.com/nhammond101/cloudfront-ip-ranges/commit/3f28f8679058eee47452ba11c012499d512406e3))


### Documentation

* Demonstrate ES6 usage ([426dd07](https://github.com/nhammond101/cloudfront-ip-ranges/commit/426dd07894dd3bf19451f48f5bcbf4f4c5d5ca4c))


### Features

* v1.1.0 ([2ce059d](https://github.com/nhammond101/cloudfront-ip-ranges/commit/2ce059dc2ddb2060bdc8d3258441f93fea451b4e))


### BREAKING CHANGES

* Node 8 no longer supported
63 changes: 38 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,68 @@ Get Cloudfront IPs for use in trust proxy configurations.

This package will be updated if Cloudfront ever decides to change the endpoints for retrieving current IPs. We will most likely never see a breaking change for this package.

_V2 drops support for Node v8_

<br>
<p align="center">
<img width="460" src="https://github.com/nhammond101/cloudfront-ip-ranges/raw/main/README-image.png?raw=true">
</p>

## Install

Requires node `8` or newer.
Requires node `10` or newer, but only [LTS](https://nodejs.org/en/about/releases/) are officially supported .

npm install --save cloudfront-ip-ranges
```shell
npm install --save cloudfront-ip-ranges
```

## Usage

For use in an Express environment please see [Express documentation on trust proxies](https://expressjs.com/en/guide/behind-proxies.html).

It is recommended to use `setInterval` for updating the IP list periodically.

#### Directly update trust proxies for an Express app
### Directly update trust proxies for an Express app

```javascript
const cfIPranges = require('cloudfront-ip-ranges');

const cfIPranges = require('cloudfront-ip-ranges')
cfIPranges.updateTrustProxy(app);

cfIPranges.updateTrustProxy(app)

setInterval(() => {
cfIPranges.updateTrustProxy(app)
}, 1000*60*60*12)
setInterval(() => {
cfIPranges.updateTrustProxy(app);
}, 1000 * 60 * 60 * 12);
```

#### Getting a list of IPs and updating trust proxies manually
### Getting a list of IPs and updating trust proxies manually

Useful if you need to list other proxies alongside the Cloudfront ones.

const cfIPranges = require('cloudfront-ip-ranges')

cfIPranges.updateIPs()
.then((ips) => {
app.set('trust proxy', ['loopback', ...ips])
})
```javascript
const cfIPranges = require('cloudfront-ip-ranges');

cfIPranges.updateIPs().then((ips) => {
app.set('trust proxy', ['loopback', ...ips]);
});
```

### ES6

You can import the module like so:

```javascript
import {CloudfrontService} from "cloudfront-ip-ranges";

new CloudfrontService().getIpRange().then( (ips)=> ...);
```

## API

Method | Info
------------ | -------------
getIpRange | By default returns `Promise<string[]>`.
updateTrustProxy | Takes an Express app instance as an argument. Returns `Promise<void>`.
| Method | Info |
| ---------------- | ---------------------------------------------------------------------- |
| getIpRange | By default returns `Promise<string[]>`. |
| updateTrustProxy | Takes an Express app instance as an argument. Returns `Promise<void>`. |

## Changelog

Version | Release notes
------------ | -------------
0.1.2 | Dependency updates
0.1.1 | Added local IP to trust proxy
0.1.0 | Initial release.
see [CHANGELOG.md](./CHANGELOG.md)
31 changes: 11 additions & 20 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
module.exports = {
collectCoverage: false,
coverageReporters: [
"json-summary",
"lcov",
"text"
],
moduleFileExtensions: [
"ts",
"tsx",
"js",
"json"
],
preset: "ts-jest",
coverageReporters: ['json-summary', 'lcov', 'text'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
preset: 'ts-jest',
reporters: [
"default",
'default',
[
"jest-junit",
'jest-junit',
{
output: "./test-reports/junit.xml"
}
]
output: './test-reports/junit.xml',
},
],
],
testRegex: "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
testEnvironment: "node",
verbose: true
testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$',
testEnvironment: 'node',
verbose: true,
};
Loading