Skip to content

Commit

Permalink
chore: remove import map (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato committed Aug 7, 2020
1 parent 76a8bc3 commit 9bd2ca8
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 31 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Deno environment
uses: denolib/setup-deno@v1.3.0
with:
deno-version: v1.2.0
deno-version: v1.2.2

- uses: actions/checkout@v2

Expand All @@ -30,10 +30,10 @@ jobs:

- name: Compile API endpoints
run: |
deno cache --unstable --importmap ./import_map.json ./api/async/publish.ts
deno cache --unstable --importmap ./import_map.json ./api/builds/get.ts
deno cache --unstable --importmap ./import_map.json ./api/modules/list.ts
deno cache --unstable --importmap ./import_map.json ./api/webhook/github.ts
deno cache --unstable ./api/async/publish.ts
deno cache --unstable ./api/builds/get.ts
deno cache --unstable ./api/modules/list.ts
deno cache --unstable ./api/webhook/github.ts
- name: Build
run: sam build
Expand Down
2 changes: 1 addition & 1 deletion API.md
Expand Up @@ -11,7 +11,7 @@ The contents and headers should be a GitHub `create` webhook event. More informa
There are some query parameters that change the request:

- `subdir`: this specifies a subdirectory of the repository to upload (not set by default). This directory must be in the format `std/`.
- `version_prefix`: only upload versions that match this prefix. When this is set to `std/` and you tag version `std/0.61.0`, version `0.61.0` will be uploaded.
- `version_prefix`: only upload versions that match this prefix. When this is set to `std/` and you tag version `std/0.63.0`, version `0.63.0` will be uploaded.

### Response

Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Expand Up @@ -5,11 +5,10 @@ RUN pip install awscli

WORKDIR /app

COPY import_map.json .
COPY deps.ts .
RUN deno cache --unstable --importmap import_map.json deps.ts
RUN deno cache --unstable deps.ts
COPY test_deps.ts .
RUN deno cache --unstable --importmap import_map.json test_deps.ts
RUN deno cache --unstable test_deps.ts

ADD . .

Expand Down
16 changes: 8 additions & 8 deletions Makefile
@@ -1,19 +1,19 @@
build-WebhookGithubFunction:
deno bundle --unstable --importmap ./import_map.json ./api/webhook/github.ts > $(ARTIFACTS_DIR)/bundle.js
deno bundle --unstable ./api/webhook/github.ts > $(ARTIFACTS_DIR)/bundle.js
# Cache the mongo plugin
cd $(ARTIFACTS_DIR) && deno run -A --unstable --importmap ../../../import_map.json ../../../deps.ts
cd $(ARTIFACTS_DIR) && deno run -A --unstable ../../../deps.ts

build-ModulesListFunction:
deno bundle --unstable --importmap ./import_map.json ./api/modules/list.ts > $(ARTIFACTS_DIR)/bundle.js
deno bundle --unstable ./api/modules/list.ts > $(ARTIFACTS_DIR)/bundle.js
# Cache the mongo plugin
cd $(ARTIFACTS_DIR) && deno run -A --unstable --importmap ../../../import_map.json ../../../deps.ts
cd $(ARTIFACTS_DIR) && deno run -A --unstable ../../../deps.ts

build-AsyncPublishFunction:
deno bundle --unstable --importmap ./import_map.json ./api/async/publish.ts > $(ARTIFACTS_DIR)/bundle.js
deno bundle --unstable ./api/async/publish.ts > $(ARTIFACTS_DIR)/bundle.js
# Cache the mongo plugin
cd $(ARTIFACTS_DIR) && deno run -A --unstable --importmap ../../../import_map.json ../../../deps.ts
cd $(ARTIFACTS_DIR) && deno run -A --unstable ../../../deps.ts

build-BuildsGetFunction:
deno bundle --unstable --importmap ./import_map.json ./api/builds/get.ts > $(ARTIFACTS_DIR)/bundle.js
deno bundle --unstable ./api/builds/get.ts > $(ARTIFACTS_DIR)/bundle.js
# Cache the mongo plugin
cd $(ARTIFACTS_DIR) && deno run -A --unstable --importmap ../../../import_map.json ../../../deps.ts
cd $(ARTIFACTS_DIR) && deno run -A --unstable ../../../deps.ts
8 changes: 3 additions & 5 deletions deps.ts
Expand Up @@ -4,11 +4,9 @@ export {
expandGlob,
walk,
readJsonSync,
} from "https://deno.land/std@0.61.0/fs/mod.ts";
export { join } from "https://deno.land/std@0.61.0/path/mod.ts";
} from "https://deno.land/std@0.63.0/fs/mod.ts";
export { join } from "https://deno.land/std@0.63.0/path/mod.ts";
export { S3Bucket } from "https://raw.githubusercontent.com/lucacasonato/deno_s3/fa75e7a745c6856ef03add70a8cb37fb37e818ce/mod.ts";
export { prettyBytes } from "https://raw.githubusercontent.com/brunnerlivio/deno-pretty-bytes/master/mod.ts";
export * as YAML from "https://deno.land/std@0.61.0/encoding/yaml.ts";
export type {
APIGatewayProxyEventV2,
APIGatewayProxyResultV2,
Expand All @@ -19,6 +17,6 @@ export type {
export {
MongoClient,
ObjectId,
} from "https://raw.githubusercontent.com/lucacasonato/deno_mongo_lambda/3f407a302c883f1a84fc6c4aebf28a45ff3aa49e/mod.ts";
} from "https://raw.githubusercontent.com/lucacasonato/deno_mongo_lambda/v0.10.0/mod.ts";
export { SQSQueue } from "https://raw.githubusercontent.com/lucacasonato/deno_sqs/6685e2a534122c01e3bfacbe6e590b8e5931633f/mod.ts";
export { lookup } from "https://deno.land/x/media_types@v2.4.3/mod.ts";
5 changes: 0 additions & 5 deletions import_map.json

This file was deleted.

2 changes: 1 addition & 1 deletion run-tests.sh
Expand Up @@ -18,4 +18,4 @@ export BUILD_QUEUE=http://sqs:9324/000000000000/builds
export STORAGE_BUCKET=deno-registry2
export S3_ENDPOINT_URL=http://s3:9000

deno test --unstable --importmap import_map.json -A
deno test --unstable -A
2 changes: 1 addition & 1 deletion template.yaml
Expand Up @@ -8,7 +8,7 @@ Resources:
Properties:
Location:
ApplicationId: arn:aws:serverlessrepo:us-east-1:390065572566:applications/deno
SemanticVersion: 1.2.1
SemanticVersion: 1.2.2

DenoHttpApi:
Type: AWS::Serverless::HttpApi
Expand Down
4 changes: 2 additions & 2 deletions test_deps.ts
Expand Up @@ -4,5 +4,5 @@ export {
assert,
assertEquals,
assertThrows,
} from "https://deno.land/std@0.61.0/testing/asserts.ts";
export { readJson } from "https://deno.land/std@0.61.0/fs/mod.ts";
} from "https://deno.land/std@/testing/asserts.ts";
export { readJson } from "https://deno.land/std@/fs/mod.ts";

0 comments on commit 9bd2ca8

Please sign in to comment.