Skip to content

Commit

Permalink
feat: drop support for Node.js < 14
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Feb 14, 2023
1 parent 6f34544 commit 120db72
Show file tree
Hide file tree
Showing 9 changed files with 5,195 additions and 16,633 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
{
files: 'test/**/*.+(t|j)s',
rules: {
'max-lines-per-function': 'off',
'no-magic-numbers': 'off',
'promise/prefer-await-to-callbacks': 'off',
'unicorn/filename-case': 'off',
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [8.17.0, '*']
node-version: [14.18.0, '*']
exclude:
- os: macOS-latest
node-version: 8.17.0
node-version: 14.18.0
- os: windows-latest
node-version: 8.17.0
node-version: 14.18.0
fail-fast: false
steps:
- name: Git checkout
Expand Down
21,422 changes: 4,983 additions & 16,439 deletions package-lock.json

Large diffs are not rendered by default.

23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"prepare": "husky install node_modules/@netlify/eslint-config-node/.husky/",
"prepack": "npm run build",
"prepublishOnly": "npm ci && npm test",
"test": "run-s format test:dev",
"format": "run-s build format:check-fix:*",
"format:ci": "run-s build format:check:*",
"format:check-fix:lint": "run-e format:check:lint format:fix:lint",
Expand All @@ -22,11 +21,10 @@
"format:check-fix:prettier": "run-e format:check:prettier format:fix:prettier",
"format:check:prettier": "cross-env-shell prettier --check $npm_package_config_prettier",
"format:fix:prettier": "cross-env-shell prettier --write $npm_package_config_prettier",
"test:dev": "run-s build test:dev:*",
"test:ci": "run-s build test:ci:*",
"test:dev:ava": "ava",
"test": "run-s format test:dev:*",
"test:dev:tsd": "tsd",
"test:ci:ava": "nyc -r lcovonly -r text -r json ava"
"test:dev:vitest": "vitest run",
"test:ci": "vitest run --coverage"
},
"config": {
"eslint": "--ignore-pattern README.md --ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{src,scripts,.github,test}/**/*.{ts,js,md,html}\" \"*.{ts,js,md,html}\" \".*.{ts,js,md,html}\"",
Expand Down Expand Up @@ -55,17 +53,18 @@
"is-promise": "^4.0.0"
},
"devDependencies": {
"@commitlint/cli": "^17.0.0",
"@commitlint/config-conventional": "^17.0.0",
"@commitlint/cli": "^17.4.3",
"@commitlint/config-conventional": "^17.4.3",
"@netlify/eslint-config-node": "^7.0.1",
"ava": "^2.4.0",
"husky": "^7.0.4",
"@vitest/coverage-c8": "^0.28.5",
"husky": "^8.0.3",
"npm-run-all": "^4.1.5",
"nyc": "^15.0.0",
"tsd": "^0.25.0",
"typescript": "^4.4.4"
"typescript": "^4.9.5",
"vite": "^4.1.1",
"vitest": "^0.28.5"
},
"engines": {
"node": ">=8.3.0"
"node": ">=14.16.0"
}
}
1 change: 0 additions & 1 deletion src/lib/secrets_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ const findLoggedInServicesQuery = `query FindLoggedInServicesQuery {
const getSecretsForToken = async (token: string): Promise<NetlifySecrets> => {
const body = JSON.stringify({ query: findLoggedInServicesQuery })

// eslint-disable-next-line n/no-unsupported-features/node-builtins
const resultBody = await graphRequest(token, new TextEncoder().encode(body))
const result: GraphSecretsResponse = JSON.parse(resultBody)

Expand Down
8 changes: 4 additions & 4 deletions test/helpers/main.js → test/helpers/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const invokeLambda = (handler, { method = 'GET', ...options } = {}) => {
import { Event } from '../../src/function/event.js'

export const invokeLambda = (handler, { method = 'GET', ...options }: Partial<Event> & { method?: string } = {}) => {
const event = {
...options,
httpMethod: method,
}

return new Promise((resolve, reject) => {
const callback = (error, response) => {
const callback = (error: Error, response: unknown) => {
if (error) {
reject(error)
} else {
Expand All @@ -16,5 +18,3 @@ const invokeLambda = (handler, { method = 'GET', ...options } = {}) => {
resolve(handler(event, {}, callback))
})
}

module.exports = { invokeLambda }
174 changes: 0 additions & 174 deletions test/unit/builder.js

This file was deleted.

Loading

0 comments on commit 120db72

Please sign in to comment.