@webdevcody/liftoff
Advanced tools
+3
| import serverlessExpress from "@vendia/serverless-express"; | ||
| import { app } from "./src"; | ||
| exports.handler = serverlessExpress({ app }); |
+1
-1
| { | ||
| "name": "@webdevcody/liftoff", | ||
| "version": "0.0.3", | ||
| "version": "0.0.4", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
| #!/bin/bash -e | ||
| SCRIPT_DIR=$(dirname "$(readlink -f "$0")") | ||
| # Run TypeScript build | ||
| rm -rf dist | ||
| npx tsc --outDir dist | ||
| mkdir -p dist | ||
| # Run TypeScript build | ||
| rm -rf tmp | ||
| mkdir -p tmp | ||
| mkdir -p tmp/prisma | ||
| cp -R dist/* tmp | ||
| cp -R src tmp/src | ||
| cp prisma/schema.prisma tmp/prisma | ||
| cp package.json tmp | ||
| cp $SCRIPT_DIR/../index.js tmp | ||
| cp $SCRIPT_DIR/../index.ts tmp | ||
| pushd tmp | ||
| npm i @vendia/serverless-express | ||
| npm i --production | ||
| npx prisma generate | ||
| mkdir -p out/src/routes | ||
| npx esbuild index.ts --bundle --outdir=out --platform=node | ||
| mkdir -p out/.prisma/client | ||
| cp -R ./node_modules/.prisma/client/libquery_engine-rhel-* out | ||
| cp -R ./node_modules/.prisma/client/libquery_engine-rhel-* out/.prisma/client | ||
| find src/routes -name '*.ts' | while read filepath; do | ||
| outdir="out/$(dirname "$filepath")"; | ||
| mkdir -p $outdir; | ||
| echo "outdir $outdir" | ||
| cp ../prisma/schema.prisma $outdir | ||
| npx esbuild "$filepath" --bundle --outdir="$outdir" --platform=node; | ||
| done | ||
| # find out/src/routes -name '*.js' -exec sh -c 'mv "$0" "${0%.js}.mjs"' {} \; | ||
| # find out -name '*.js' -exec sh -c 'mv "$0" "${0%.js}.mjs"' {} \; | ||
| popd | ||
| # Create the archive | ||
| rm -rf out | ||
| mkdir -p out | ||
| pushd tmp | ||
| zip -r "../out/payload.zip" . | ||
| cp prisma/schema.prisma tmp/out | ||
| pushd tmp/out | ||
| zip -r "../../out/payload.zip" . | ||
| popd | ||
@@ -44,3 +44,9 @@ #!/bin/bash -e | ||
| --region "$AWS_REGION" | ||
| echo "Lambda function '$FUNCTION_NAME' updated successfully." | ||
| # Publish a new version of the function | ||
| while ! aws lambda publish-version --function-name "$FUNCTION_NAME" --region "$AWS_REGION" --output text --query 'Version'; do | ||
| echo "Retrying publish-version command in 5 seconds..." | ||
| sleep 5 | ||
| done | ||
| echo "New version published successfully" | ||
| else | ||
@@ -47,0 +53,0 @@ # Create the Lambda function |
@@ -16,3 +16,3 @@ #!/bin/bash -e | ||
| $SCRIPT_DIR/compile-project.sh | ||
| $SCRIPT_DIR/setup-s3.sh | ||
| # $SCRIPT_DIR/setup-s3.sh | ||
| $SCRIPT_DIR/deploy-lambda.sh |
-5
| const serverlessExpress = require("@vendia/serverless-express"); | ||
| const { app } = require("./src"); | ||
| console.log("we are here"); | ||
| console.log("app", app); | ||
| exports.handler = serverlessExpress({ app }); |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
4565
25.72%3
-40%