Skip to content

Commit

Permalink
refactor!: remove node.js v16 support, remove node-fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Sep 19, 2023
1 parent 795186b commit 8dbcfa6
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 111 deletions.
7 changes: 0 additions & 7 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ module.exports = {
'plugin:unicorn/recommended',
],

globals: {
// TODO remove `node-fetch` module with node.js v18+ support
// TODO file bug with eslint? those should be global now
fetch: true,
Headers: true,
},

parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
node-version: [16, 18, 20]
node-version: [18, 20]

steps:
- uses: actions/checkout@v4
Expand Down
85 changes: 0 additions & 85 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"jsonschema": "^1.4.1",
"jszip": "^3.10.1",
"luxon": "^3.2.0",
"node-fetch": "^3.3.2",
"node-schedule": "^2.1.1",
"p-memoize": "^7.1.1",
"p-retry": "^6.0.0",
Expand Down
8 changes: 0 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
// install global fetch
// TODO remove `node-fetch` module and use global built-in with node.js v18+ support
if (globalThis.fetch === undefined) {
const { default: fetch, Headers } = await import('node-fetch')
globalThis.fetch = fetch
globalThis.Headers = Headers
}

export { default } from './ServerlessOffline.js'
8 changes: 0 additions & 8 deletions tests/mochaHooks.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ const { env } = require('node:process')

exports.mochaHooks = {
async beforeAll() {
// install global fetch
// TODO remove `node-fetch` module and use global built-in with node.js v18+ support
if (globalThis.fetch === undefined) {
const { default: fetch, Headers } = await import('node-fetch')
globalThis.fetch = fetch
globalThis.Headers = Headers
}

const { checkDockerDaemon, checkGoVersion, detectExecutable } =
await import('../src/utils/index.js')

Expand Down
1 change: 0 additions & 1 deletion tests/runtimes/python/python-module/python-module.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import assert from 'node:assert'
import { platform } from 'node:os'
import { env } from 'node:process'
import { join } from 'desm'
import fetch from 'node-fetch'
import { setup, teardown } from '../../../_testHelpers/index.js'
import { BASE_URL } from '../../../config.js'

Expand Down

0 comments on commit 8dbcfa6

Please sign in to comment.