Skip to content

Commit

Permalink
minify bundle, use node 22
Browse files Browse the repository at this point in the history
  • Loading branch information
devksingh4 committed Jan 25, 2025
1 parent e632ccd commit 559e1ab
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 67 deletions.
15 changes: 14 additions & 1 deletion cloudformation/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,27 @@ Resources:
Type: AWS::Serverless::Function
DependsOn:
- AppLogGroups
Metadata:
BuildMethod: esbuild
BuildProperties:
Format: esm
Minify: true
OutExtension:
- .js=.js
Target: "node22"
Sourcemap: false
EntryPoints:
- api/lambda.js
External:
- aws-sdk
Properties:
Architectures: [arm64]
CodeUri: ../dist
AutoPublishAlias: live
Runtime: nodejs22.x
Description: !Sub "${ApplicationFriendlyName} API Lambda"
FunctionName: !Sub ${ApplicationPrefix}-lambda
Handler: api/lambda.handler
Handler: lambda.handler
MemorySize: 512
Role: !GetAtt AppSecurityRoles.Outputs.MainFunctionRoleArn
Timeout: 60
Expand Down
33 changes: 4 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"scripts": {
"build": "yarn workspaces run build && yarn lockfile-manage",
"dev": "concurrently --names 'api,ui' 'yarn workspace infra-core-api run dev' 'yarn workspace infra-core-ui run dev'",
"lockfile-manage": "synp --with-workspace --source-file yarn.lock && cp package-lock.json dist/ && cp package.json dist/ && rm package-lock.json",
"lockfile-manage": "synp --with-workspace --source-file yarn.lock && cp package-lock.json dist/ && cp src/api/package.json dist/ && rm package-lock.json",
"prettier": "yarn workspaces run prettier && prettier --check tests/**/*.ts",
"prettier:write": "yarn workspaces run prettier:write && prettier --write tests/**/*.ts",
"lint": "yarn workspaces run lint",
Expand All @@ -25,35 +25,11 @@
"test:e2e": "playwright test",
"test:e2e-ui": "playwright test --ui"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.624.0",
"@aws-sdk/client-secrets-manager": "^3.624.0",
"@aws-sdk/util-dynamodb": "^3.624.0",
"@azure/msal-node": "^2.16.1",
"@fastify/auth": "^5.0.1",
"@fastify/aws-lambda": "^5.0.0",
"@fastify/caching": "^9.0.1",
"@fastify/cors": "^10.0.1",
"@touch4it/ical-timezones": "^1.9.0",
"discord.js": "^14.15.3",
"dotenv": "^16.4.5",
"fastify": "^5.1.0",
"fastify-plugin": "^4.5.1",
"ical-generator": "^7.2.0",
"jsonwebtoken": "^9.0.2",
"jwks-rsa": "^3.1.0",
"moment": "^2.30.1",
"moment-timezone": "^0.5.45",
"node-cache": "^5.1.2",
"pluralize": "^8.0.0",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.2",
"zod-validation-error": "^3.3.1"
},
"dependencies": {},
"devDependencies": {
"@eslint/compat": "^1.1.1",
"@playwright/test": "^1.49.1",
"@tsconfig/node20": "^20.1.4",
"@tsconfig/node22": "^22.0.0",
"@types/node": "^22.1.0",
"@types/pluralize": "^0.0.33",
"@types/react": "^18.3.3",
Expand Down Expand Up @@ -82,7 +58,6 @@
"husky": "^9.1.4",
"identity-obj-proxy": "^3.0.0",
"jsdom": "^24.1.1",
"node-ical": "^0.18.0",
"postcss": "^8.4.41",
"postcss-preset-mantine": "^1.17.0",
"postcss-simple-vars": "^7.0.1",
Expand All @@ -106,4 +81,4 @@
"resolutions": {
"pdfjs-dist": "^4.8.69"
}
}
}
30 changes: 28 additions & 2 deletions src/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,33 @@
"prettier:write": "prettier --write *.ts **/*.ts"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.624.0",
"@aws-sdk/client-secrets-manager": "^3.624.0",
"@aws-sdk/client-sts": "^3.726.0",
"node-cache": "^5.1.2"
"@aws-sdk/util-dynamodb": "^3.624.0",
"@azure/msal-node": "^2.16.1",
"@fastify/auth": "^5.0.1",
"@fastify/aws-lambda": "^5.0.0",
"@fastify/caching": "^9.0.1",
"@fastify/cors": "^10.0.1",
"@touch4it/ical-timezones": "^1.9.0",
"discord.js": "^14.15.3",
"dotenv": "^16.4.5",
"esbuild": "^0.24.2",
"fastify": "^5.1.0",
"fastify-plugin": "^4.5.1",
"ical-generator": "^7.2.0",
"jsonwebtoken": "^9.0.2",
"jwks-rsa": "^3.1.0",
"moment": "^2.30.1",
"moment-timezone": "^0.5.45",
"node-cache": "^5.1.2",
"pluralize": "^8.0.0",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.2",
"zod-validation-error": "^3.3.1"
},
"devDependencies": {
"@tsconfig/node22": "^22.0.0"
}
}
}
2 changes: 1 addition & 1 deletion src/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"extends": "@tsconfig/node22/tsconfig.json",
"compilerOptions": {
"module": "Node16",
"rootDir": "../",
Expand Down
42 changes: 8 additions & 34 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3212,10 +3212,10 @@
resolved "https://registry.yarnpkg.com/@touch4it/ical-timezones/-/ical-timezones-1.9.0.tgz#bbd85014f55b5cc3e9079ed7caccd8649b5170a3"
integrity sha512-UAiZMrFlgMdOIaJDPsKu5S7OecyMLr3GGALJTYkRgHmsHAA/8Ixm1qD09ELP2X7U1lqgrctEgvKj9GzMbczC+g==

"@tsconfig/node20@^20.1.4":
version "20.1.4"
resolved "https://registry.yarnpkg.com/@tsconfig/node20/-/node20-20.1.4.tgz#3457d42eddf12d3bde3976186ab0cd22b85df928"
integrity sha512-sqgsT69YFeLWf5NtJ4Xq/xAF8p4ZQHlmGW74Nu2tD4+g5fAsposc4ZfaaPixVu4y01BEiDCWLRDCvDM5JOsRxg==
"@tsconfig/node22@^22.0.0":
version "22.0.0"
resolved "https://registry.yarnpkg.com/@tsconfig/node22/-/node22-22.0.0.tgz#0bdaf702f2b7594383d24d7b2b8d557dcfdca1ed"
integrity sha512-twLQ77zevtxobBOD4ToAtVmuYrpeYUh3qh+TEp+08IWhpsrIflVHqQ1F1CiPxQGL7doCdBIOOCF+1Tm833faNg==

"@types/aria-query@^5.0.1":
version "5.0.4"
Expand Down Expand Up @@ -4044,15 +4044,6 @@ axe-core@^4.10.0:
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.10.2.tgz#85228e3e1d8b8532a27659b332e39b7fa0e022df"
integrity sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w==

axios@1.6.7:
version "1.6.7"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7"
integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==
dependencies:
follow-redirects "^1.15.4"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

axios@^1.7.3:
version "1.7.9"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.9.tgz#d7d071380c132a24accda1b2cfc1535b79ec650a"
Expand Down Expand Up @@ -5012,7 +5003,7 @@ esbuild-register@^3.5.0:
dependencies:
debug "^4.3.4"

"esbuild@^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0":
"esbuild@^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0", esbuild@^0.24.2:
version "0.24.2"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.24.2.tgz#b5b55bee7de017bff5fb8a4e3e44f2ebe2c3567d"
integrity sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==
Expand Down Expand Up @@ -5745,7 +5736,7 @@ flatted@^3.2.9, flatted@^3.3.1:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.2.tgz#adba1448a9841bec72b42c532ea23dbbedef1a27"
integrity sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==

follow-redirects@^1.15.4, follow-redirects@^1.15.6:
follow-redirects@^1.15.6:
version "1.15.9"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1"
integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==
Expand Down Expand Up @@ -7090,7 +7081,7 @@ mnemonist@0.39.8:
dependencies:
obliterator "^2.0.1"

moment-timezone@^0.5.44, moment-timezone@^0.5.45:
moment-timezone@^0.5.45:
version "0.5.46"
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.46.tgz#a21aa6392b3c6b3ed916cd5e95858a28d893704a"
integrity sha512-ZXm9b36esbe7OmdABqIWJuBBiLLwAjrN7CE+7sYdCCx82Nabt1wHDj8TVseS59QIlfFPbOoiBPm6ca9BioG4hw==
Expand Down Expand Up @@ -7167,16 +7158,6 @@ node-cache@^5.1.2:
dependencies:
clone "2.x"

node-ical@^0.18.0:
version "0.18.0"
resolved "https://registry.yarnpkg.com/node-ical/-/node-ical-0.18.0.tgz#919ab65f43cdfebb4ac9a1c2acca2b5e62cc003f"
integrity sha512-FrOUPztjw9OUgSB9o/ffhl86BiVClQTut97C2NqCwKIgOAcKPEw5UQMuSuNJO/Y4hqTyJdKZh2TCqNHQnE9YFg==
dependencies:
axios "1.6.7"
moment-timezone "^0.5.44"
rrule "2.8.1"
uuid "^9.0.0"

node-releases@^2.0.19:
version "2.0.19"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314"
Expand Down Expand Up @@ -8121,13 +8102,6 @@ rollup@^4.20.0:
"@rollup/rollup-win32-x64-msvc" "4.29.2"
fsevents "~2.3.2"

rrule@2.8.1:
version "2.8.1"
resolved "https://registry.yarnpkg.com/rrule/-/rrule-2.8.1.tgz#e8341a9ce3e68ce5b8da4d502e893cd9f286805e"
integrity sha512-hM3dHSBMeaJ0Ktp7W38BJZ7O1zOgaFEsn41PDk+yHoEtfLV+PoJt9E9xAlZiWgf/iqEqionN0ebHFZIDAp+iGw==
dependencies:
tslib "^2.4.0"

rrweb-cssom@^0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz#c73451a484b86dd7cfb1e0b2898df4b703183e4b"
Expand Down Expand Up @@ -9059,7 +9033,7 @@ tslib@^1.9.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslib@^2.0.0, tslib@^2.0.1, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.6.2, tslib@^2.6.3:
tslib@^2.0.0, tslib@^2.0.1, tslib@^2.1.0, tslib@^2.6.2, tslib@^2.6.3:
version "2.8.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f"
integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
Expand Down

0 comments on commit 559e1ab

Please sign in to comment.