Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
Merge tag 'v1.54.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
jazmon committed Dec 4, 2024
2 parents 213fec8 + 1fa8550 commit ce94c81
Show file tree
Hide file tree
Showing 38 changed files with 4,322 additions and 2,140 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
node-version: [18, 20, 22]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
node-version: [18, 20, 22]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 18
- run: npm ci
- run: npx semantic-release
env:
Expand Down
1 change: 1 addition & 0 deletions .vscode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
settings.json
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

- Zero-config: Works out of the box without the need to install any additional plugins
- Works with Typescript and Javascript projects
- Guaranteed to work in Node.js v18 and higher environments
- Supports `sls package`, `sls deploy`, `sls deploy function`
- Integrates with [`Serverless Invoke Local`](https://www.serverless.com/framework/docs/providers/aws/cli-reference/invoke-local) & [`serverless-offline`](https://github.com/dherault/serverless-offline)

Expand Down Expand Up @@ -89,6 +90,7 @@ See [example folder](examples) for some example configurations.
| `packagerOptions` | Extra options for packagers for `external` dependency resolution. | [Packager Options](#packager-options) |
| `watch` | Watch options for `serverless-offline`. | [Watch Options](#watch-options) |
| `skipBuild` | Avoid rebuilding lambda artifacts in favor of reusing previous build artifacts. | `false` |
| `skipRebuild` | A boolean defining whether rebuild is avoided. Generally rebuild produces faster builds but in some context scenarios with many lambdas or low memory computer (like Github Actions) it can cause memory leaks. | `false` |
| `skipBuildExcludeFns` | An array of lambda names that will always be rebuilt if `skipBuild` is set to `true` and bundling individually. This is helpful for dynamically generated functions like serverless-plugin-warmup. | `[]` |
| `stripEntryResolveExtensions` | A boolean that determines if entrypoints using custom file extensions provided in the `resolveExtensions` ESbuild setting should be stripped of their custom extension upon packing the final bundle for that file. Example: `myLambda.custom.ts` would result in `myLambda.js` instead of `myLambda.custom.js`.
| `disposeContext` | An option to disable the disposal of the context.(Functions can override the global `disposeContext` configuration by specifying their own `disposeContext` option in their individual configurations.) | `true`
Expand All @@ -102,7 +104,7 @@ The following `esbuild` options are automatically set.
| `entryPoints` | N/A | Cannot be overridden |
| `outDir` | N/A | Cannot be overridden |
| `platform` | `'node'` | Set `format` to `esm` to enable ESM support |
| `target` | `'node16'` | We dynamically set this. See [Supported Runtimes](#supported-runtimes) |
| `target` | `'node18'` | We dynamically set this. See [Supported Runtimes](#supported-runtimes) |
| `watch` | N/A | Cannot be overridden |

#### Packager Options
Expand Down Expand Up @@ -281,6 +283,16 @@ module.exports = (serverless) => {

As long as the plugin is properly installed, all regular Serverless operations `sls package`, `sls deploy`, `sls deploy function`, `sls invoke local`, `sls offline` will automatically compile using `serverless-esbuild`.

### Specify a custom entrypoint for a function

You can specify a custom entrypoint for ESBuild by specifying the `esbuildEntrypoint` field in your function definition.
```typescript
export const myLambdaFunction = {
handler: '/opt/nodejs/node_modules/my_custom_extension/handler.handler',
esbuildEntrypoint: './handler.main',
};
```

### Serverless Offline

The plugin integrates very well with [serverless-offline](https://github.com/dherault/serverless-offline) to
Expand Down
2 changes: 1 addition & 1 deletion e2e/__snapshots__/complete.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ exports[`complete 5`] = `
"Arn",
],
},
"Runtime": "nodejs12.x",
"Runtime": "nodejs18.x",
"Timeout": 6,
},
"Type": "AWS::Lambda::Function",
Expand Down
4 changes: 2 additions & 2 deletions e2e/__snapshots__/individually.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ exports[`individually 6`] = `
"Arn",
],
},
"Runtime": "nodejs12.x",
"Runtime": "nodejs18.x",
"Timeout": 6,
},
"Type": "AWS::Lambda::Function",
Expand Down Expand Up @@ -295,7 +295,7 @@ exports[`individually 6`] = `
"Arn",
],
},
"Runtime": "nodejs12.x",
"Runtime": "nodejs18.x",
"Timeout": 6,
},
"Type": "AWS::Lambda::Function",
Expand Down
2 changes: 1 addition & 1 deletion e2e/__snapshots__/minimal.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14227,7 +14227,7 @@ exports[`minimal 5`] = `
"Arn",
],
},
"Runtime": "nodejs12.x",
"Runtime": "nodejs18.x",
"Timeout": 6,
},
"Type": "AWS::Lambda::Function",
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"devDependencies": {
"@types/node": "^18.7.21",
"esbuild": "^0.20.0",
"esbuild": "^0.24.0",
"serverless": "^3.22.0",
"serverless-esbuild": "file:../..",
"serverless-offline": "^10.2.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ custom:

provider:
name: aws
runtime: nodejs12.x
runtime: nodejs18.x

functions:
validateIsin:
Expand Down
2 changes: 1 addition & 1 deletion examples/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"devDependencies": {
"@types/lodash": "4.14.185",
"@types/node": "^18.7.21",
"esbuild": "^0.20.0",
"esbuild": "^0.24.0",
"serverless": "^3.22.0",
"serverless-esbuild": "file:../..",
"serverless-offline": "^10.2.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/config/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package:

provider:
name: aws
runtime: nodejs12.x
runtime: nodejs18.x

custom:
esbuild:
Expand Down
2 changes: 1 addition & 1 deletion examples/individually/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"devDependencies": {
"@types/lodash": "4.14.185",
"@types/node": "^18.7.21",
"esbuild": "^0.20.0",
"esbuild": "^0.24.0",
"serverless": "^3.22.0",
"serverless-esbuild": "file:../..",
"serverless-offline": "^10.2.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/individually/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package:

provider:
name: aws
runtime: nodejs12.x
runtime: nodejs18.x

custom:
esbuild:
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"devDependencies": {
"@types/node": "^18.7.21",
"esbuild": "^0.20.0",
"esbuild": "^0.24.0",
"serverless": "^3.22.0",
"serverless-esbuild": "file:../..",
"serverless-offline": "^10.2.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins:

provider:
name: aws
runtime: nodejs12.x
runtime: nodejs18.x

functions:
validateIsin:
Expand Down
Loading

0 comments on commit ce94c81

Please sign in to comment.