Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Update to 0.40.0 (#66)
Browse files Browse the repository at this point in the history
* Update to 0.40.0

* deno fetch -> deno cache
  • Loading branch information
lucacasonato authored Apr 8, 2020
1 parent cc3f525 commit 4babbdc
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion example-sam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion example-sam/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example-serverless/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 2 additions & 2 deletions example-serverless/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion example-serverless/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions runtime/artifacts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 3 additions & 3 deletions runtime/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
8 changes: 4 additions & 4 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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 .

Expand Down
4 changes: 2 additions & 2 deletions tests/deps.ts
Original file line number Diff line number Diff line change
@@ -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";
4 changes: 2 additions & 2 deletions tests/test_bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_example_zip.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_js.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_run_deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_self_contained.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 4babbdc

Please sign in to comment.