Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/support nodejs18 esmodule #535

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b7b3a42
Preset localstack debug commands
kai-nguyen-aligent Aug 18, 2022
caec768
Merge remote-tracking branch 'origin/kai-nguyen-aligent-prettier-rule…
kai-nguyen-aligent Aug 18, 2022
90947c9
Update localstack to latest v1.0.4
kai-nguyen-aligent Aug 18, 2022
62d066e
Expose nodejs debug port on serverless container
kai-nguyen-aligent Aug 18, 2022
4821131
Added env variable for debugging in dev stage (localstack)
kai-nguyen-aligent Aug 18, 2022
bf5aa5d
Added dev configs for deploying to localstack
kai-nguyen-aligent Aug 19, 2022
fd2a29a
Added back localstack init
kai-nguyen-aligent Aug 19, 2022
fe2cc0d
Added VSCode debugger configurations
kai-nguyen-aligent Aug 19, 2022
acfd909
Update ReadMe with updated info
kai-nguyen-aligent Aug 19, 2022
b65e330
Fix a typo to ignore the real vscode folder
kai-nguyen-aligent Aug 19, 2022
f191916
Minor tweak to make debugging with Jest smoother.
kai-nguyen-aligent Aug 22, 2022
5209d9e
Merge commit 'd4736d56e0ec137051ba5bc7f8248c96e3c7c9f1' into feature/…
kai-nguyen-aligent Aug 22, 2022
10fcee2
Added build task for debug image
kai-nguyen-aligent Sep 6, 2022
10a55ac
Fixed some feedbacks
kai-nguyen-aligent Sep 6, 2022
0cc6c69
Update Readme, mention about VSCode Docker extension
kai-nguyen-aligent Sep 7, 2022
b02deca
Prevent errors when start/stop localstack from different workspaces
kai-nguyen-aligent Sep 7, 2022
2c9f6e4
Minor change to alias to match with VSCode tasks
kai-nguyen-aligent Sep 7, 2022
73fac61
Moved .localstack to home & fix its permission to machine's user
kai-nguyen-aligent Sep 9, 2022
148e261
Update tasks to match with latest serverless docker image.
kai-nguyen-aligent Sep 9, 2022
c8e7d03
Fixed an issue when localstack has stopped while we try to start it
kai-nguyen-aligent Sep 9, 2022
a258e33
Minor ReadMe update
kai-nguyen-aligent Sep 15, 2022
1127732
Merge commit '2181fb022e23603b3f9cd10c7af236273c64d613' into feature/…
kai-nguyen-aligent Nov 24, 2022
70275c9
Use dotevn for reading environment vars
kai-nguyen-aligent Nov 24, 2022
4ad2819
Renamed .vscode-config to .vscode
kai-nguyen-aligent Nov 24, 2022
2cf1bac
Update ReadMe & added recommended extensions
kai-nguyen-aligent Nov 24, 2022
24ad37d
Added esm configuration for esbuild
kai-nguyen-aligent Nov 28, 2022
b15fd42
Rename & update debug configurations
kai-nguyen-aligent Nov 28, 2022
90e1eb1
Moved node debug settings to Docker image
kai-nguyen-aligent Nov 28, 2022
bdfacae
Removed redundant packages
kai-nguyen-aligent Nov 28, 2022
352db4b
Update dependencies to latest version
kai-nguyen-aligent Nov 28, 2022
4329f98
Set type to module & update package.json
kai-nguyen-aligent Nov 29, 2022
fd24a38
Update tsconfig to support esm
kai-nguyen-aligent Nov 29, 2022
dd49653
Moved all aws config to folder
kai-nguyen-aligent Nov 29, 2022
3902d55
Added top-level await when getting ssm example
kai-nguyen-aligent Nov 29, 2022
ea8eda2
Remove nvmrc as we do not use nvm
kai-nguyen-aligent Nov 29, 2022
4b6533a
Update node engine configs
kai-nguyen-aligent Nov 29, 2022
ce877d1
Enable experimental-vm-modules while running Jest
kai-nguyen-aligent Nov 29, 2022
e599d56
Update ts-jest configuration to use ESM
kai-nguyen-aligent Nov 29, 2022
2f3985e
Update serverless-esbuild configs
kai-nguyen-aligent Nov 29, 2022
829373a
Added node environment to eslint
kai-nguyen-aligent Nov 29, 2022
e3ab4de
Added mock example & follow AAA unit test pattern
kai-nguyen-aligent Nov 30, 2022
f700b91
Remove `source-map-support` package from lambda
kai-nguyen-aligent Nov 30, 2022
313e494
Added example of getting SSM params
kai-nguyen-aligent Nov 30, 2022
9a5cb35
Pass ssm root to world lambda
kai-nguyen-aligent Nov 30, 2022
78cbc60
Update few types packages
kai-nguyen-aligent Nov 30, 2022
cc582c2
Update workflow to node 18.12
kai-nguyen-aligent Nov 30, 2022
fe704a8
Add test to cover branch coverage
kai-nguyen-aligent Nov 30, 2022
6e50ae1
Fix esbuild config file referencing syntax
kai-nguyen-aligent Nov 30, 2022
24e6144
Switch default stage to stg
kai-nguyen-aligent Nov 30, 2022
db6a544
Commented out iamRoleStatement as it affect git workflow
kai-nguyen-aligent Nov 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
]
],
"env": {
"node": true
}
}
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.11]
node-version: [18.12]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jspm_packages
# ESBuild directories
.build

vscode
.vscode

# Localstack directories
.localstack
Expand Down
18 changes: 18 additions & 0 deletions .localstack-init/init.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
#!/bin/sh

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheOrangePuff could you review this section?

# Make sure user has ownership of ~/.localstack
LOCALSTACK_INIT="/docker-entrypoint-initaws.d/localstack-init.sh"
DEPLOY_USER="deployer"

DOCKER_UID=`stat -c "%u" $LOCALSTACK_INIT`
DOCKER_GID=`stat -c "%g" $LOCALSTACK_INIT`

if id -u $DEPLOY_USER >/dev/null 2>&1; then
userdel $DEPLOY_USER
fi

groupadd -g ${DOCKER_GID} ${DEPLOY_USER}
useradd -g ${DOCKER_GID} --home-dir /home/${DEPLOY_USER} -s /bin/bash -u ${DOCKER_UID} ${DEPLOY_USER}

chown -R ${DEPLOY_USER}:${DEPLOY_USER} /var/lib/localstack

# Add the creation of any AWS resource you want using the awslocal cli tool
awslocal ssm put-parameter --name "/example/ssm/param" --type String --value "some-value" --overwrite
awslocal ssm get-parameter --name "/example/ssm/param"
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"ms-azuretools.vscode-docker"
]
}
34 changes: 34 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Invoke Local Debug",
"type": "node",
"request": "attach",
"address": "localhost",
"port": 9229,
"sourceMaps": true,
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app",
"outFiles": ["${workspaceFolder}/.esbuild/**/*.js"],
"internalConsoleOptions": "neverOpen",
"preLaunchTask": "sls-docker: invoke-local-debug"
},
{
"name": "Jest Test Debug",
"type": "node",
"request": "attach",
"address": "localhost",
"port": 9229,
"sourceMaps": true,
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app",
"outFiles": ["${workspaceFolder}/.esbuild/**/*.js"],
"internalConsoleOptions": "neverOpen",
"preLaunchTask": "sls-docker: jest-test-debug"
}
]
}
Loading