Skip to content

Commit 436388e

Browse files
authored
Merge pull request #138 from capralifecycle/cals-924/migrate-to-esm
cals 924/migrate to esm
2 parents 7572a71 + a5498cf commit 436388e

File tree

12 files changed

+622
-39
lines changed

12 files changed

+622
-39
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ jobs:
6161
run: npm ci
6262

6363
- name: npm - lint
64-
run: npm run lint
64+
run: make npm-lint
6565

6666
- name: npm - test
67-
run: npm test
67+
run: make npm-test
6868

6969
- name: conditionally semantic release
7070
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ __pycache__/
66
node_modules/
77
/lib/
88
/*.tgz
9+
.idea

Makefile

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,59 @@
1-
all:
2-
@echo "Specify a valid target"
3-
@exit 1
1+
VENV = .venv/bin
2+
3+
.PHONY: all
4+
all: install-deps build fmt lint test
5+
6+
.PHONY: install-deps
7+
install-deps:
8+
@echo "=== Running target: install-deps ==="
9+
npm install --ignore-scripts
10+
python3 -m venv .venv && \
11+
$(VENV)/pip install -r requirements.txt
12+
13+
.PHONY: build
14+
build:
15+
@echo "=== Running target: build ==="
16+
npm run build # runs build through prepare-script
17+
18+
.PHONY: test
19+
test: npm-test py-test
20+
21+
npm-test:
22+
@echo "=== Running target: npm-test ==="
23+
npm run test
424

525
py-test:
26+
@echo "=== Running target: py-test ==="
627
TARGET_BUCKET_URL=s3://dummy/web \
728
EXPIRE_SECONDS=86400 \
829
DEPLOY_LOG_BUCKET_URL=s3://dummy/deployments.log \
9-
python -m unittest discover webapp_deploy
30+
$(VENV)/python -m unittest discover webapp_deploy
31+
32+
.PHONY: fmt
33+
fmt:
34+
npm run lint:fix
35+
$(VENV)/black webapp_deploy
36+
37+
.PHONY: npm-fmt
38+
npm-fmt:
39+
@echo "=== Running target: npm-fmt ==="
40+
npm run format
41+
42+
.PHONY: py-fmt
43+
py-fmt:
44+
@echo "=== Running target: py-fmt ==="
45+
$(VENV)/black webapp_deploy
46+
47+
.PHONY: lint
48+
lint: npm-lint py-lint
1049

11-
py-format:
12-
black webapp_deploy
50+
.PHONY: npm-lint
51+
npm-lint:
52+
@echo "=== Running target: npm-lint ==="
53+
npm run lint
1354

55+
.PHONY: py-lint
1456
py-lint:
15-
flake8 --exclude .venv webapp_deploy
16-
black --check webapp_deploy
57+
@echo "=== Running target: py-lint ==="
58+
$(VENV)/flake8 --exclude .venv webapp_deploy
59+
$(VENV)/black --check webapp_deploy

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ threshold.
88
What it does:
99

1010
1. Fetch deployment log from S3
11-
1. Fetch bundled artifact and extract locally with optional filtering
12-
1. Upload all non-html files to S3
13-
1. Upload html files to S3
14-
1. Add uploaded items to deployment log
15-
1. Delete old items from S3
16-
1. Prune old deployments from deployment log
17-
1. Store deployment log to S3 for next run
18-
1. Optionally invalidate CloudFront distribution
11+
2. Fetch bundled artifact and extract locally with optional filtering
12+
3. Upload all non-html files to S3
13+
4. Upload html files to S3
14+
5. Add uploaded items to deployment log
15+
6. Delete old items from S3
16+
7. Prune old deployments from deployment log
17+
8. Store deployment log to S3 for next run
18+
9. Optionally invalidate CloudFront distribution
1919

2020
## Preserving old files
2121

@@ -44,7 +44,7 @@ aws lambda invoke \
4444
--payload '{
4545
"ResourceProperties": {
4646
"artifactS3Url": "s3://my-bucket/my-release.tgz"
47-
},
47+
},
4848
"RequestType": "Update"
4949
}' \
5050
/tmp/out.log
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module.exports = {
1+
export default {
22
extends: ["@commitlint/config-conventional"],
33
}

jest.config.js renamed to jest.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
testMatch: ["**/*.test.ts"],
33
transform: {
44
"^.+\\.tsx?$": "ts-jest",

0 commit comments

Comments
 (0)