serverless-http-invoker 3.0.15 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,9 @@ updates:
8
8
  day: "friday"
9
9
  allow:
10
10
  - dependency-type: "direct"
11
+ ignore:
12
+ - dependency-name: "serverless"
13
+ update-types: ["version-update:semver-major"]
11
14
  commit-message:
12
15
  # for production deps, prefix commit messages with "fix" (trigger a patch release)
13
16
  prefix: "fix"
@@ -1,25 +1,76 @@
1
- # We want pushes to main, beta, and alpha to trigger a publish to npm for the corresponding npm dist-tag.
2
- # Any pull request targeting deploy branches should run all tests.
1
+ name: build
2
+
3
3
  on:
4
4
  push:
5
5
  branches: [main, beta, alpha]
6
-
7
6
  pull_request:
8
7
  branches: [main, beta, alpha]
9
8
 
10
9
  jobs:
11
10
  test:
12
- uses: activescott/github-actions-workflows/.github/workflows/npm-tester.yml@npm-tester-v4
13
- with:
14
- package_dir: ./
15
- node_versions: "[14, 16, 18]"
16
- do_coveralls: true
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ node: [20, 22]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Use Node.js ${{ matrix.node }}
20
+ uses: actions/setup-node@v4
21
+ with:
22
+ node-version: ${{ matrix.node }}
23
+ cache: "npm"
24
+
25
+ - name: install dependencies
26
+ run: npm ci
27
+
28
+ - name: test
29
+ env:
30
+ CI_NODE_VERSION: ${{ matrix.node }}
31
+ run: npm test
32
+
33
+ - name: publish coverage
34
+ uses: coverallsapp/github-action@v2
35
+ continue-on-error: true
36
+ with:
37
+ github-token: ${{ secrets.GITHUB_TOKEN }}
38
+ flag-name: nodejs-${{ matrix.node }}
39
+ parallel: true
40
+
41
+ coveralls_finished:
42
+ needs: test
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - name: coveralls finished
46
+ uses: coverallsapp/github-action@v2
47
+ continue-on-error: true
48
+ with:
49
+ github-token: ${{ secrets.GITHUB_TOKEN }}
50
+ parallel-finished: true
17
51
 
18
52
  publish:
19
53
  if: ${{ github.event_name != 'pull_request' }}
20
54
  needs: [test]
21
- uses: activescott/github-actions-workflows/.github/workflows/npm-publisher.yml@npm-publisher-v4.0.1
22
- with:
23
- package_dir: ./
24
- secrets:
25
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
55
+ runs-on: ubuntu-latest
56
+ environment: npm
57
+ permissions:
58
+ id-token: write # Required for npm provenance / OIDC
59
+ contents: write # Required for semantic-release to push tags and create releases
60
+ issues: write # Required for semantic-release to comment on referenced issues
61
+ pull-requests: write # Required for semantic-release to comment on referenced PRs
62
+ steps:
63
+ - uses: actions/checkout@v4
64
+
65
+ - name: Use Node.js
66
+ uses: actions/setup-node@v4
67
+ with:
68
+ node-version: 24
69
+ registry-url: "https://registry.npmjs.org"
70
+
71
+ - name: publish to npm
72
+ env:
73
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74
+ run: |
75
+ npm ci
76
+ npx semantic-release@25
package/README.md CHANGED
@@ -11,6 +11,8 @@ Locally invoke [Serverless](https://github.com/serverless/serverless) functions
11
11
 
12
12
  It makes it easy to test not only your handler logic, but also ensures that you have your http events setup properly in serverless.yml without deploying.
13
13
 
14
+ > **Note on Serverless Framework & Node.js version support:** This project currently supports **Serverless Framework v3** and **Node.js 20** (the `nodejs20.x` Lambda runtime). Supporting the `nodejs22.x` Lambda runtime [requires upgrading to Serverless Framework v4](https://github.com/serverless/serverless/issues/12922#issuecomment-2563870220), which I haven't done yet. I maintain a number of open source projects and want to dedicate my time to the ones people are actively using. If you'd like to see support for Serverless v4 and Node.js 22, please [open an issue](https://github.com/activescott/serverless-http-invoker/issues) requesting it or submit a pull request — I'm happy to support it! — _Scott Willeke_
15
+
14
16
  <!-- TOC -->
15
17
 
16
18
  - [Usage / Quick Start](#usage--quick-start)
@@ -48,11 +50,9 @@ An exhaustive list of what is supported in Some of the more common use cases are
48
50
 
49
51
  ## Prerequisites / Usage Requirements
50
52
 
51
- Requires Node.js latest, LTS, and v10 ([tested](https://travis-ci.org/activescott/serverless-http-invoker)).
52
-
53
- If you need Node.js v6.x - v9.x support you can use [serverless-http-invoker@0.8.6](https://www.npmjs.com/package/serverless-http-invoker/v/0.8.6).
53
+ Requires Node.js 20 ([tested](https://github.com/activescott/serverless-http-invoker/actions)).
54
54
 
55
- Requires Serverless Framework v1.x.
55
+ Requires Serverless Framework v3.
56
56
  If you are new to the Serverless Framework, check out the [Serverless Framework Getting Started Guide](https://serverless.com/framework/docs/getting-started/).
57
57
 
58
58
  ## Install
@@ -2,7 +2,7 @@ service: basic-example
2
2
 
3
3
  provider:
4
4
  name: aws
5
- runtime: nodejs14.x
5
+ runtime: nodejs20.x
6
6
  region: us-west-2
7
7
 
8
8
  functions:
@@ -2,7 +2,7 @@ service: basic-example # NOTE: update this with your service name
2
2
 
3
3
  provider:
4
4
  name: aws
5
- runtime: nodejs14.x
5
+ runtime: nodejs20.x
6
6
  region: us-west-2
7
7
 
8
8
  environment:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "serverless-http-invoker",
3
- "version": "3.0.15",
3
+ "version": "4.0.0",
4
4
  "description": "Locally invoke Serverless functions via their HTTP event as specified in Serverless.yml for testing.",
5
5
  "main": "index.js",
6
6
  "author": "Scott Willeke <scott@willeke.com> (https:/scott.willeke.com/)",
@@ -24,7 +24,7 @@
24
24
  "tdd"
25
25
  ],
26
26
  "engines": {
27
- "node": ">=14"
27
+ "node": ">=20"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",
@@ -47,9 +47,9 @@
47
47
  "serverless": "^3.22.0"
48
48
  },
49
49
  "devDependencies": {
50
- "chai": "^4.3.6",
51
- "chai-as-promised": "^7.1.1",
52
- "mocha": "^10.0.0",
50
+ "chai": "^4.5.0",
51
+ "chai-as-promised": "^7.1.2",
52
+ "mocha": "^11.7.5",
53
53
  "nyc": "^15.1.0",
54
54
  "prettier": "^2.7.1",
55
55
  "serverless": "^3.31.0"
@@ -1,4 +1,5 @@
1
1
  "use strict"
2
2
  const chai = require("chai")
3
3
  var chaiAsPromised = require("chai-as-promised")
4
- chai.use(chaiAsPromised)
4
+ // chai-as-promised 8.x is ESM-only; require() returns a module namespace object
5
+ chai.use(chaiAsPromised.default || chaiAsPromised)