-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpackage.json
More file actions
109 lines (109 loc) · 7.96 KB
/
package.json
File metadata and controls
109 lines (109 loc) · 7.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{
"name": "portable-aws-app",
"version": "1.0.0",
"description": "Portable application for Local Server, Docker, AWS Lambda, ECS and EKS",
"main": "dist/index.js",
"author": {
"name": "Daniel Abib",
"email": "daniabib@amazon.com"
},
"dependencies": {
"@vendia/serverless-express": "^4.12.6",
"express": "^5.0.1"
},
"devDependencies": {
"@types/aws-lambda": "^8.10.147",
"@types/express": "^5.0.0",
"@types/jest": "^29.5.14",
"@types/node": "^22.10.5",
"@types/supertest": "^6.0.2",
"axios": "^1.6.7",
"jest": "^29.7.0",
"node-mocks-http": "^1.16.2",
"supertest": "^7.0.0",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.7.2"
},
"scripts": {
"===================================================================": "",
"======================= ARCHITECTURES ============================": "",
"=====================================================================": "",
"****************** MONOLITH ***": "",
"monolith:build": "npm run remove && tsc -p src/01-Monolith/tsconfig.json && echo 'Monolithic Architecture' > dist/ARCHITECTURE-MONOLITH",
"monolith:test": "jest --config src/01-Monolith/jest.config.js --detectOpenHandles --no-watchman --verbose --silent --coverage",
"monolith:local": "npm run monolith:build && node dist/server.js",
"monolith:test:e2e": "npm run test:e2e local",
"monolith:all": "npm run monolith:build && npm run monolith:local",
"****************** LAYERED ***": "",
"layered:build": "npm run remove && tsc -p src/02-Layered/tsconfig.json && echo 'Layered Architecture' > dist/ARCHITECTURE-LAYERED",
"layered:test": "jest --config src/02-Layered/jest.config.js --detectOpenHandles --no-watchman --verbose --silent --coverage",
"layered:local": "npm run layered:build && node dist/server.js",
"layered:test:e2e": "npm run test:e2e local",
"layered:all": "npm run layered:build && npm run layered:local",
"****************** CLEAN ARCHITECTURE ***": "",
"clean:build": "npm run remove && tsc -p src/04-CleanArchitecture/tsconfig.json && echo 'Clean Architecture' > dist/ARCHITECTURE-CLEAN",
"clean:test": "jest --config src/04-CleanArchitecture/jest.config.js --detectOpenHandles --no-watchman --verbose --silent --coverage",
"clean:local": "npm run clean:build && ts-node src/04-CleanArchitecture/infrastructure/local/server.ts",
"clean:test:e2e": "npm run test:e2e local",
"clean:all": "npm run clean:build && npm run clean:local",
"****************** HEXAGONAL ARCHITECTURE ***": "",
"hexagonal:build": "npm run remove && tsc -p src/03-HexagonalArchitecture/tsconfig.json && echo 'Hexagonal Architecture' > dist/ARCHITECTURE-HEXAGONAL",
"hexagonal:test": "jest --config src/03-HexagonalArchitecture/jest.config.js --detectOpenHandles --no-watchman --verbose --silent --coverage",
"hexagonal:local": "npm run hexagonal:build && ts-node src/03-HexagonalArchitecture/server.ts",
"hexagonal:test:e2e": "npm run test:e2e local",
"hexagonal:all": "npm run hexagonal:build && npm run hexagonal:local",
"****************** COMMON SCRIPTS DEVELOPMENT ***": "",
"remove": "rm -rf dist",
"test:e2e": "ts-node src/e2e-tests/test.ts",
"test:all": "jest --detectOpenHandles --no-watchman --verbose --silent --coverage",
"remember": "./scripts/remember.sh",
"=================================================================": "",
"========================== DEPLOYMENT ================================": "",
"====================================================================": "",
"****************** DOCKER ***": "",
"docker:build": "npm run remember && docker build -t portable-app . --platform=linux/amd64 --no-cache --load",
"docker:local": "npm run docker:kill && docker run -p 3000:3000 portable-app",
"docker:all": "npm run docker:build && npm run docker:local",
"docker:kill": "docker ps -q --filter publish=3000 | xargs -r docker stop",
"docker:test:e2e": "npm run test:e2e local",
"****************** LAMBDA ZIP ***": "",
"lambda:zip:build": "npm run remember && cp package.json dist/ && cd dist && npm install --production && cd ../deployment/lambda/zip && sam build",
"lambda:zip:local": "cd deployment/lambda/zip && sam local start-api -p 3000 --warm-containers EAGER",
"lambda:zip:deploy": "cd deployment/lambda/zip && sam deploy",
"lambda:zip:deploy:all": "npm run lambda:zip:build && npm run lambda:zip:deploy",
"lambda:zip:outputs": "aws cloudformation describe-stacks --stack-name portable-lambda-zip --query 'Stacks[0].Outputs' --output text --no-paginate --no-cli-pager",
"lambda:zip:test:e2e": "npm run test:e2e zip",
"lambda:zip:delete": "cd deployment/lambda/zip && sam delete --no-prompts",
"****************** LAMBDA CONTAINER ***": "",
"lambda:container:build": "npm run remember && cd deployment/lambda/container && sam build",
"lambda:container:local": "cd deployment/lambda/container && sam local start-api -p 3000 --warm-containers EAGER",
"lambda:container:deploy": "cd deployment/lambda/container && sam deploy --resolve-image-repos",
"lambda:container:deploy:all": "npm run lambda:container:build && npm run lambda:container:deploy",
"lambda:container:outputs": "aws cloudformation describe-stacks --stack-name portable-lambda-container --query 'Stacks[0].Outputs' --output text --no-paginate --no-cli-pager",
"lambda:container:test:e2e": "npm run test:e2e container",
"lambda:container:delete": "cd deployment/lambda/container && sam delete --no-prompts",
"****************** LAMBDA WEB-ADAPTER ***": "",
"lambda:web-adapter:build": "npm run remember && cd deployment/lambda/web-adapter && ./prepare-adapter.sh && sam build",
"lambda:web-adapter:local": "cd deployment/lambda/web-adapter && sam local start-api -p 3000 --warm-containers EAGER",
"lambda:web-adapter:deploy": "cd deployment/lambda/web-adapter && sam deploy --resolve-image-repos",
"lambda:web-adapter:deploy:all": "npm run lambda:web-adapter:build && npm run lambda:web-adapter:deploy",
"lambda:web-adapter:outputs": "aws cloudformation describe-stacks --stack-name portable-lambda-web-adapter --query 'Stacks[0].Outputs' --output text --no-paginate --no-cli-pager",
"lambda:web-adapter:test:e2e": "npm run test:e2e web-adapter",
"lambda:web-adapter:delete": "cd deployment/lambda/web-adapter && sam delete --no-prompts",
"****************** ECS ***": "",
"container:ecs:deploy:infrastructure": "./deployment/ecs/deploy-base.sh",
"container:ecs:build": "./scripts/check-container-requirements.sh && npm run remember",
"container:ecs:deploy:service": "export IMAGE_TAG=$(date +%Y%m%d%H%M%S) && docker buildx build --platform=linux/amd64 --no-cache --load -t portable-container-ecs:$IMAGE_TAG -f Dockerfile . && ./deployment/ecs/deploy-service.sh",
"container:ecs:deploy:all": "npm run container:ecs:deploy:infrastructure && npm run container:ecs:build && npm run container:ecs:deploy:service",
"container:ecs:test:e2e": "npm run test:e2e ecs",
"container:ecs:delete": "aws cloudformation delete-stack --stack-name portable-ecs-service && aws cloudformation wait stack-delete-complete --stack-name portable-ecs-service && aws cloudformation delete-stack --stack-name portable-ecs && ./deployment/ecs/container-delete.sh",
"****************** EKS ***": "",
"container:eks:deploy:infrastructure": "./deployment/eks/deploy-base.sh",
"container:eks:build": "./scripts/check-container-requirements.sh && npm run remember",
"container:eks:deploy:service": "npm run container:eks:build && ./deployment/eks/deploy-service.sh",
"container:eks:deploy:all": "npm run container:eks:deploy:infrastructure && npm run container:eks:build && npm run container:eks:deploy:service",
"container:eks:test:e2e": "npm run test:e2e eks",
"container:eks:delete": "kubectl delete -f deployment/eks/k8s-deployment.yaml && eksctl delete cluster --name portable-eks --region $(aws configure get region) && ./deployment/eks/container-delete.sh"
}
}