-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from humanmade/v3-branch
Switch to typescript and response streaming
- Loading branch information
Showing
37 changed files
with
21,588 additions
and
6,985 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Build PR | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- run: npm install | ||
- run: npx tsc | ||
- uses: aws-actions/setup-sam@v2 | ||
with: | ||
use-installer: true | ||
- run: npm run build | ||
- run: npm run build-zip | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: lambda.zip | ||
name: lambda | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- run: npm install | ||
- run: npx tsc | ||
- uses: aws-actions/setup-sam@v2 | ||
with: | ||
use-installer: true | ||
- run: npm run build | ||
- run: npm run build-zip | ||
- uses: softprops/action-gh-release@v1 | ||
with: | ||
files: lambda.zip | ||
name: lambda | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
node_modules/ | ||
.idea | ||
lambda.zip | ||
config.json | ||
test-filesize/output | ||
.aws-sam/ | ||
test-filesize | ||
.DS_Store | ||
dist/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
# Contributing | ||
|
||
## Release Process | ||
## Building | ||
|
||
You'll need to [install the AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html) as AWS SAM is used to build the ZIP and text the fixtures. | ||
|
||
``` | ||
npm install | ||
npm run build // Builds the function for use in SAM | ||
npm run test // Invoke a function via SAM using a fixture from ./events/ | ||
``` | ||
|
||
|
||
1. Create and push a new tag following the convention `vx.x.x` | ||
1. Build a new ZIP file by running `npm run build-node-modules && npm run build-zip` | ||
1. Publish a new GitHub release, uploading `lambda.zip` as the built artifact to GitHub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
FROM public.ecr.aws/lambda/nodejs:14 | ||
COPY node_modules/ /var/task/node_modules | ||
COPY server.js /var/task/ | ||
COPY index.js /var/task | ||
COPY proxy-file.js /var/task | ||
FROM public.ecr.aws/lambda/nodejs:18 | ||
COPY package.json /var/task/ | ||
COPY package-lock.json /var/task/ | ||
RUN npm install --omit=dev | ||
COPY dist /var/task/dist | ||
|
||
ARG AWS_REGION | ||
ARG AWS_S3_BUCKET | ||
ARG AWS_S3_ENDPOINT | ||
# Set environment variables, backwards compat with Tachyon 2x. | ||
ARG S3_REGION | ||
ARG S3_BUCKET | ||
ARG S3_ENDPOINT | ||
ARG PORT | ||
|
||
# Start the reactor | ||
EXPOSE ${PORT:-8080} | ||
ENTRYPOINT /var/lang/bin/node server.js ${PORT:-8080} | ||
ENTRYPOINT /var/lang/bin/node dist/server.js ${PORT:-8080} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.