Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 4 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '22'
cache: 'yarn'

- name: Install dependencies
Expand All @@ -25,7 +25,7 @@ jobs:
run: yarn build

- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
Expand All @@ -42,15 +42,13 @@ jobs:
steps:
- name: Setup AWS SAM
run: |
brew tap aws/tap
brew install aws-sam-cli
sam --version

- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '22'
cache: 'yarn'

- name: Install dependencies
Expand All @@ -75,7 +73,7 @@ jobs:
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Download build artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist
path: dist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '22'
cache: 'yarn'

- name: Install Dependencies
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.1.0 (July 17, 2025)

- Add support for Node.js `16+`

## 3.0.0 (Mai 20, 2022)

- Adds support for `nodejs16.x` Lambda runtime ([#14](https://github.com/milliHQ/sammy/pull/14))
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ A Node.js wrapper for [AWS SAM CLI](https://aws.amazon.com/serverless/sam/) for
## Usage

```sh
npm i -D @millihq/sammy # npm
yarn add -D @millihq/sammy # or yarn
npm i -D howdygo-sammy # npm
yarn add -D howdygo-sammy # or yarn
```

Assuming you have a Lambda function with the following content:
Expand Down Expand Up @@ -34,14 +34,14 @@ You can now start the Lambda function locally and access it through an API-Endpo
```ts
import * as path from 'path';

import { generateAPISAM, APISAMGenerator } from '@millihq/sammy';
import { generateAPISAM, APISAMGenerator } from 'howdygo-sammy';

const lambdaSAM = await generateAPISAM({
lambdas: {
first: {
filename: 'lambda.zip',
handler: 'handler.handler',
runtime: 'nodejs16.x',
runtime: 'nodejs22.x',
route: '/test',
method: 'get',
},
Expand Down
7 changes: 3 additions & 4 deletions lib/SAMTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const defaultFunctionProperties: Pick<
PartialServerLessFunctionProps
> = {
MemorySize: 128, // in mb
Runtime: 'nodejs16.x',
Runtime: 'nodejs22.x',
Timeout: 30, // in seconds
};

Expand Down Expand Up @@ -80,9 +80,8 @@ class SAMTemplate {
this.template.Resources[functionName].Properties.Events = {};
}

this.template.Resources[functionName].Properties.Events![
routeKey
] = apiEvent;
this.template.Resources[functionName].Properties.Events![routeKey] =
apiEvent;

this.addAPIGatewayOutput();
}
Expand Down
9 changes: 7 additions & 2 deletions lib/generateProxyModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ const LambdaFunctionName = 'proxy';
interface Props {
pathToProxyPackage: string;
proxyConfig: string;
runtime?: 'nodejs12.x' | 'nodejs14.x' | 'nodejs16.x';
runtime?:
| 'nodejs12.x'
| 'nodejs14.x'
| 'nodejs16.x'
| 'nodejs18.x'
| 'nodejs20.x'
| 'nodejs22.x';
onData?: (data: any) => void;
onError?: (data: any) => void;
cliOptions?: SAMLocalLambadCLIOptions;
Expand Down Expand Up @@ -201,7 +207,6 @@ export async function generateProxySAM({
domainName: 's3.local',
path: '',
authMethod: 'none',
region: 'local',
},
},
querystring: url.searchParams.toString(),
Expand Down
8 changes: 7 additions & 1 deletion lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
type LambdaRuntime = 'nodejs12.x' | 'nodejs14.x' | 'nodejs16.x';
type LambdaRuntime =
| 'nodejs12.x'
| 'nodejs14.x'
| 'nodejs16.x'
| 'nodejs18.x'
| 'nodejs20.x'
| 'nodejs22.x';

export interface ServerLessFunctionAPIEvent {
Type: 'Api' | 'HttpApi';
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/deferred.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export function createDeferred<T>() {
}
);

return ({ promise, resolve: r, reject: j } as unknown) as Deferred<T>;
return { promise, resolve: r, reject: j } as unknown as Deferred<T>;
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@millihq/sammy",
"version": "3.0.0",
"name": "howdygo-sammy",
"version": "4.1.0",
"main": "dist/index.js",
"license": "Apache-2.0",
"repository": {
Expand All @@ -14,7 +14,7 @@
"fix:prettier": "prettier --write ."
},
"dependencies": {
"aws-sdk": "^2.1055.0",
"aws-sdk": "^2.1630.0",
"change-case": "^4.1.2",
"get-port": "^5.1.1",
"node-fetch": "^2.6.7",
Expand All @@ -29,13 +29,12 @@
"@types/jest": "^27.0.1",
"@types/node": "^12.0.0",
"@types/node-fetch": "^2.5.8",
"@types/rimraf": "^3.0.2",
"@types/tmp": "^0.2.0",
"@types/unzipper": "^0.10.3",
"archiver": "^5.3.1",
"jest": "^27.1.0",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"rimraf": "^5.0.7",
"ts-jest": "^27.0.5",
"typescript": "^4.4.2"
},
Expand All @@ -44,5 +43,6 @@
],
"engines": {
"node": ">=14.0.0"
}
},
"packageManager": "yarn@1.22.22"
}
2 changes: 1 addition & 1 deletion test/api-gateway.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('integration:Api-Gateway', () => {
first: {
filename: 'first.zip',
handler: 'handler.handler',
runtime: 'nodejs16.x',
runtime: 'nodejs22.x',
route,
method: 'get',
},
Expand Down
2 changes: 1 addition & 1 deletion test/event.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('integration:Event', () => {
[functionName]: {
filename: 'first.zip',
handler: 'handler.handler',
runtime: 'nodejs16.x',
runtime: 'nodejs22.x',
},
},
cwd: tmpdir,
Expand Down
Loading