From 4babbdc13bbb0abb65fb09faf19c46d777288bce Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 8 Apr 2020 22:29:07 +0200 Subject: [PATCH] Update to 0.40.0 (#66) * Update to 0.40.0 * deno fetch -> deno cache --- .github/workflows/ci.yml | 2 +- README.md | 4 ++-- example-sam/README.md | 2 +- example-sam/template.yml | 2 +- example-serverless/deps.ts | 2 +- example-serverless/serverless.yml | 4 ++-- example-serverless/test.ts | 2 +- runtime/artifacts | 4 ++-- runtime/bootstrap | 6 +++--- tests/Dockerfile | 8 ++++---- tests/deps.ts | 4 ++-- tests/test_bundle.json | 4 ++-- tests/test_example_zip.json | 4 ++-- tests/test_js.json | 4 ++-- tests/test_run_deno.json | 4 ++-- tests/test_self_contained.json | 4 ++-- tests/test_simple.json | 4 ++-- 17 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ca58293..1c51c2ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v2 - uses: denolib/setup-deno@master with: - deno-version: 0.39.0 + deno-version: 0.40.0 - name: start a local dynamodb run: | mkdir dyno diff --git a/README.md b/README.md index c32bed99..528a049d 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ you must do the following directory remapping: ``` # Compile the handler (and fetch dependencies into DENO_DIR). -DENO_DIR=.deno_dir deno fetch hello.ts +DENO_DIR=.deno_dir deno cache hello.ts # This is the "remapping" step: cp -R .deno_dir/gen/file/$PWD/ .deno_dir/LAMBDA_TASK_ROOT @@ -157,7 +157,7 @@ plugins: custom: scriptHooks: - before:package:createDeploymentArtifacts: DENO_DIR=.deno_dir deno fetch api/candidate.ts && cp -R .deno_dir/gen/file/$PWD/ .deno_dir/LAMBDA_TASK_ROOT + before:package:createDeploymentArtifacts: DENO_DIR=.deno_dir deno cache api/candidate.ts && cp -R .deno_dir/gen/file/$PWD/ .deno_dir/LAMBDA_TASK_ROOT ``` See [`example-serverless/serverless.yml`](https://github.com/hayd/deno-lambda/blob/master/example-serverless/serverless.yml). diff --git a/example-sam/README.md b/example-sam/README.md index a41fdeef..a2e8238a 100644 --- a/example-sam/README.md +++ b/example-sam/README.md @@ -7,7 +7,7 @@ An example [Serverless Application Model](https://aws.amazon.com/serverless/sam/ ```sh # Prior to deploy compile the application into .deno_dir. # (ensure you're using the same version of deno as deno-lambda.) -DENO_DIR=.deno_dir deno fetch hello.ts +DENO_DIR=.deno_dir deno cache hello.ts cp -R .deno_dir/gen/file/$PWD/ .deno_dir/LAMBDA_TASK_ROOT sam deploy --stack-name YOUR_APP_NAME --s3-bucket YOUR_BUCKET_NAME --s3-prefix YOUR_PREFIX --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND ``` diff --git a/example-sam/template.yml b/example-sam/template.yml index 4b082491..08842c25 100644 --- a/example-sam/template.yml +++ b/example-sam/template.yml @@ -11,7 +11,7 @@ Resources: Properties: Location: ApplicationId: arn:aws:serverlessrepo:us-east-1:390065572566:applications/deno - SemanticVersion: 0.39.0 + SemanticVersion: 0.40.0 HelloWorldFunction: Type: AWS::Serverless::Function diff --git a/example-serverless/deps.ts b/example-serverless/deps.ts index bacec25b..4524a0ad 100644 --- a/example-serverless/deps.ts +++ b/example-serverless/deps.ts @@ -4,5 +4,5 @@ export { DynamoDBClient } from "https://deno.land/x/dynamodb@v0.3.1/mod.ts"; -import { v4 } from "https://deno.land/std@v0.39.0/uuid/mod.ts"; +import { v4 } from "https://deno.land/std@v0.40.0/uuid/mod.ts"; export const uuid = v4.generate; diff --git a/example-serverless/serverless.yml b/example-serverless/serverless.yml index 0c880c94..68816ecc 100644 --- a/example-serverless/serverless.yml +++ b/example-serverless/serverless.yml @@ -64,7 +64,7 @@ resources: Properties: Location: ApplicationId: arn:aws:serverlessrepo:us-east-1:390065572566:applications/deno - SemanticVersion: 0.39.0 + SemanticVersion: 0.40.0 candidatesTable: Type: AWS::DynamoDB::Table @@ -85,4 +85,4 @@ plugins: custom: scriptHooks: - before:package:createDeploymentArtifacts: DENO_DIR=.deno_dir deno fetch api/candidate.ts && cp -R .deno_dir/gen/file/$PWD/ .deno_dir/LAMBDA_TASK_ROOT + before:package:createDeploymentArtifacts: DENO_DIR=.deno_dir deno cache api/candidate.ts && cp -R .deno_dir/gen/file/$PWD/ .deno_dir/LAMBDA_TASK_ROOT diff --git a/example-serverless/test.ts b/example-serverless/test.ts index d0aa3706..5fcf6cab 100644 --- a/example-serverless/test.ts +++ b/example-serverless/test.ts @@ -7,7 +7,7 @@ import { assert, assertEquals -} from "https://deno.land/std@v0.39.0/testing/asserts.ts"; +} from "https://deno.land/std@v0.40.0/testing/asserts.ts"; import { APIGatewayProxyEvent, Context diff --git a/runtime/artifacts b/runtime/artifacts index 50861f31..a09f2aaf 100644 --- a/runtime/artifacts +++ b/runtime/artifacts @@ -10,7 +10,7 @@ mkdir -p .deno_dir/deps/https/deno.land/x/lambda/ cp mod.ts .deno_dir/deps/https/deno.land/x/lambda/mod.ts cp types.d.ts .deno_dir/deps/https/deno.land/x/lambda/types.d.ts # this shouldn't require a fetch to deno.land -DENO_DIR=.deno_dir ./bin/deno fetch hello.ts +DENO_DIR=.deno_dir ./bin/deno cache hello.ts # assert the required files are going to be present in the zip ls bin/deno &> /dev/null && ls bootstrap &> /dev/null && ls hello.ts &> /dev/null @@ -24,6 +24,6 @@ DENO_DIR=.deno_dir ./bin/deno bundle hello.ts hello.bundle.js rm -rf .deno_dir mkdir -p .deno_dir/deps/https/deno.land/x/lambda/ cp mod.ts .deno_dir/deps/https/deno.land/x/lambda/mod.ts -DENO_DIR=.deno_dir ./bin/deno fetch pad.ts +DENO_DIR=.deno_dir ./bin/deno cache pad.ts cp -R .deno_dir/gen/file/$PWD/. .deno_dir/LAMBDA_TASK_ROOT zip -qq pad.zip -x '.deno_dir/gen/file/*' -r .deno_dir pad.ts diff --git a/runtime/bootstrap b/runtime/bootstrap index e54e27d8..d4777e41 100755 --- a/runtime/bootstrap +++ b/runtime/bootstrap @@ -75,15 +75,15 @@ function investigate { [ -f $DENO_LOCK ] \ || error "missing lock file '$DENO_LOCK'" # This second check might be unecessary (in that it would be caught by the 'unable to compile') - DENO_DIR=/tmp/deno_dir NO_COLOR=true deno fetch $DENO_FETCH_FLAGS $LAMBDA_TASK_ROOT/$HANDLER_FILE &> /tmp/lock.out \ + DENO_DIR=/tmp/deno_dir NO_COLOR=true deno cache $DENO_FETCH_FLAGS $LAMBDA_TASK_ROOT/$HANDLER_FILE &> /tmp/lock.out \ || error "lock file error: $(cat /tmp/lock.out)" fi - DENO_DIR=/tmp/deno_dir NO_COLOR=true deno fetch $DENO_FETCH_FLAGS $LAMBDA_TASK_ROOT/$HANDLER_FILE 2> /dev/null \ + DENO_DIR=/tmp/deno_dir NO_COLOR=true deno cache $DENO_FETCH_FLAGS $LAMBDA_TASK_ROOT/$HANDLER_FILE 2> /dev/null \ || error "unable to compile $HANDLER_FILE" echo "import { $HANDLER_NAME } from '$LAMBDA_TASK_ROOT/$HANDLER_FILE';" > /tmp/runtime-test.js - DENO_DIR=/tmp/deno_dir NO_COLOR=true deno fetch $DENO_IMPORTMAP /tmp/runtime-test.js 2> /dev/null \ + DENO_DIR=/tmp/deno_dir NO_COLOR=true deno cache $DENO_IMPORTMAP /tmp/runtime-test.js 2> /dev/null \ || error "$HANDLER_FILE must export a function named '$HANDLER_NAME'"; # FIXME perhaps a bug in bootstrap? Should we always exit 1? Or not? diff --git a/tests/Dockerfile b/tests/Dockerfile index 17e67478..248122b5 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -1,6 +1,6 @@ # Note: This must be built in the .. context -FROM hayd/amazonlinux1-deno:0.39.0 +FROM hayd/amazonlinux1-deno:0.40.0 # This is the runtime used by AWS Lambda # plus a compatible deno executable /bin/deno. # https://github.com/hayd/deno_docker @@ -25,7 +25,7 @@ RUN mkdir -p /src/runtime/bin /src/tests/bin /var/task /opt \ && cp /bin/deno /src/tests/bin/deno ADD tests/deps.ts /src/tests/deps.ts -RUN deno fetch /src/tests/deps.ts +RUN deno cache /src/tests/deps.ts ADD hello.ts /src/runtime/hello.ts ADD hello.ts /src/tests/hello.ts @@ -44,10 +44,10 @@ RUN deno run --lock-write --lock=lock.json pad.ts \ && echo {} > badlock.json ADD tests/server.ts server.ts -RUN deno fetch server.ts +RUN deno cache server.ts ADD tests/test.ts test.ts -RUN deno fetch test.ts +RUN deno cache test.ts ADD tests . diff --git a/tests/deps.ts b/tests/deps.ts index c410572b..00118bd7 100644 --- a/tests/deps.ts +++ b/tests/deps.ts @@ -1,5 +1,5 @@ export { assert, assertEquals -} from "https://deno.land/std@v0.39.0/testing/asserts.ts"; -export { serve } from "https://deno.land/std@v0.39.0/http/server.ts"; +} from "https://deno.land/std@v0.40.0/testing/asserts.ts"; +export { serve } from "https://deno.land/std@v0.40.0/http/server.ts"; diff --git a/tests/test_bundle.json b/tests/test_bundle.json index 0174e0d1..8a4ea59d 100644 --- a/tests/test_bundle.json +++ b/tests/test_bundle.json @@ -7,11 +7,11 @@ "expected": [ { "status": "ok", - "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.39.0 🦕\"}" + "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.40.0 🦕\"}" }, { "status": "ok", - "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.39.0 🦕\"}" + "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.40.0 🦕\"}" } ], "files": ["hello.bundle.js"], diff --git a/tests/test_example_zip.json b/tests/test_example_zip.json index 646728bf..cdae3f66 100644 --- a/tests/test_example_zip.json +++ b/tests/test_example_zip.json @@ -4,11 +4,11 @@ "expected": [ { "status": "ok", - "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.39.0 🦕\"}" + "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.40.0 🦕\"}" }, { "status": "ok", - "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.39.0 🦕\"}" + "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.40.0 🦕\"}" } ], "files": "deno-lambda-example.zip", diff --git a/tests/test_js.json b/tests/test_js.json index ced88b8d..2d69c24f 100644 --- a/tests/test_js.json +++ b/tests/test_js.json @@ -4,11 +4,11 @@ "expected": [ { "status": "ok", - "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.39.0 🦕\"}" + "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.40.0 🦕\"}" }, { "status": "ok", - "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.39.0 🦕\"}" + "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.40.0 🦕\"}" } ], "files": ["hello.js"], diff --git a/tests/test_run_deno.json b/tests/test_run_deno.json index e61b41c2..fe99ced2 100644 --- a/tests/test_run_deno.json +++ b/tests/test_run_deno.json @@ -4,11 +4,11 @@ "expected": [ { "status": "ok", - "content": "{\"out\":\"deno 0.39.0\"}" + "content": "{\"out\":\"deno 0.40.0\"}" }, { "status": "ok", - "content": "{\"out\":\"deno 0.39.0\"}" + "content": "{\"out\":\"deno 0.40.0\"}" } ], "files": ["handlers.ts"], diff --git a/tests/test_self_contained.json b/tests/test_self_contained.json index 5d60f305..32f38664 100644 --- a/tests/test_self_contained.json +++ b/tests/test_self_contained.json @@ -4,11 +4,11 @@ "expected": [ { "status": "ok", - "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.39.0 🦕\"}" + "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.40.0 🦕\"}" }, { "status": "ok", - "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.39.0 🦕\"}" + "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.40.0 🦕\"}" } ], "files": ["hello.ts", "bootstrap", "bin/deno"] diff --git a/tests/test_simple.json b/tests/test_simple.json index 2172490c..e9cfae62 100644 --- a/tests/test_simple.json +++ b/tests/test_simple.json @@ -4,11 +4,11 @@ "expected": [ { "status": "ok", - "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.39.0 🦕\"}" + "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.40.0 🦕\"}" }, { "status": "ok", - "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.39.0 🦕\"}" + "content": "{\"statusCode\":200,\"headers\":{\"content-type\":\"text/html;charset=utf8\"},\"body\":\"Welcome to deno 0.40.0 🦕\"}" } ], "files": ["hello.ts"],