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

Node v18 and package upgrades #6

Merged
merged 9 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.166.1/containers/typescript-node/.devcontainer/base.Dockerfile
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/v0.245.2/containers/typescript-node/.devcontainer/base.Dockerfile

# [Choice] Node.js version: 14, 12, 10
ARG VARIANT="14-buster"
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT="18-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
Expand Down
27 changes: 15 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,35 @@
"name": "Node.js & TypeScript",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 10, 12, 14
// Update 'VARIANT' to pick a Node version: 14, 16, 18
"args": {
"VARIANT": "14",
"DOCKER_VERSION": "20.10.6"
"VARIANT": "18",
"DOCKER_VERSION": "24.0.7"
}
},
"runArgs": ["--privileged"],

// Set *default* container specific settings.json values on container create.
"settings": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"terminal.integrated.defaultProfile.linux": "zsh"
"customizations": {
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": ["esbenp.prettier-vscode", "microsoft.vscode-eslint", "timonwong.shellcheck"],
// Set *default* container specific settings.json values on container create.
"settings": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"terminal.integrated.defaultProfile.linux": "zsh"
}
}
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "timonwong.shellcheck"],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "yarn install",

// Use 'postStartCommand' to run commands after the container is started.
"postStartCommand": "/dockerd-start.sh",
"postStartCommand": "sudo /dockerd-start.sh",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
//"remoteUser": "node",
Expand Down
22 changes: 5 additions & 17 deletions .github/workflows/sam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
role-duration-seconds: 900

- name: Setup NodeJS
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '14'

- name: Get Yarn Cache Directory
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Setup Cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
node-version: 18

- name: Yarn Install
run: yarn --prefer-offline
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# terraform-registry

## 0.2.0

### Major Changes

- Bump NodeJS from v14 to v18
- Resolve DevContainer deprecations
- Updates all packages to latest versions
- Updates CI GitHub Action versions

## 0.1.1

### Patch Changes
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "terraform-registry",
"description": "An AWS-based Serverless Terraform Registry",
"version": "0.1.1",
"version": "0.2.0",
"repository": "https://github.com/robburger/terraform-registry",
"author": "Rob Burger",
"license": "MIT",
Expand All @@ -16,25 +16,25 @@
"watch": "yarn build -- --watch"
},
"devDependencies": {
"@types/aws-lambda": "^8.10.79",
"@types/jest": "^26.0.24",
"@types/node": "^16.4.1",
"@types/webpack": "^5.28.0",
"@typescript-eslint/eslint-plugin": "^4.28.4",
"@typescript-eslint/parser": "^4.28.4",
"aws-sdk": "^2.950.0",
"eslint": "^7.31.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"jest": "^27.0.6",
"prettier": "^2.3.2",
"rimraf": "^3.0.2",
"ts-jest": "^27.0.3",
"ts-loader": "^9.2.3",
"ts-node": "^10.1.0",
"typescript": "^4.3.5",
"webpack": "^5.45.1",
"webpack-cli": "^4.7.2",
"yaml-cfn": "^0.3.1"
"@types/aws-lambda": "^8.10.126",
"@types/jest": "^29.5.8",
"@types/node": "^18.16.0",
"@types/webpack": "^5.28.5",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"aws-sdk": "^2.1493.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"jest": "^29.7.0",
"prettier": "^3.0.3",
"rimraf": "^5.0.5",
"ts-jest": "^29.1.1",
"ts-loader": "^9.5.0",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"yaml-cfn": "^0.3.2"
}
}
18 changes: 9 additions & 9 deletions src/lambdas/file/__snapshots__/createPreSignedURL.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`createPreSignedURL handler should return an error when invalid body data 1`] = `
Object {
"body": "{\\"error\\":\\"JSON payload invalid. Ensure you provide an object with 'namespace', 'name', 'provider' and 'version' parameters\\"}",
"headers": Object {
{
"body": "{"error":"JSON payload invalid. Ensure you provide an object with 'namespace', 'name', 'provider' and 'version' parameters"}",
"headers": {
"content-type": "application/json",
},
"statusCode": 400,
}
`;

exports[`createPreSignedURL handler should return an error when missing body data 1`] = `
Object {
"body": "{\\"error\\":\\"JSON payload invalid. Ensure you provide an object with 'namespace', 'name', 'provider' and 'version' parameters\\"}",
"headers": Object {
{
"body": "{"error":"JSON payload invalid. Ensure you provide an object with 'namespace', 'name', 'provider' and 'version' parameters"}",
"headers": {
"content-type": "application/json",
},
"statusCode": 400,
}
`;

exports[`createPreSignedURL handler should return an error when missing/invalid "type" querystring 1`] = `
Object {
"body": "{\\"error\\":\\"You need to specify a 'type' for this request. e.g. /pre-sign?type=module or /pre-sign?type=provider\\"}",
"headers": Object {
{
"body": "{"error":"You need to specify a 'type' for this request. e.g. /pre-sign?type=module or /pre-sign?type=provider"}",
"headers": {
"content-type": "application/json",
},
"statusCode": 400,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`serviceDiscovery handler should respond with a valid Terraform Service Discovery object 1`] = `
Object {
"body": "{\\"modules.v1\\":\\"https://127.0.0.1:3000/modules/v1/\\",\\"providers.v1\\":\\"https://127.0.0.1:3000/providers/v1/\\"}",
"headers": Object {
{
"body": "{"modules.v1":"https://127.0.0.1:3000/modules/v1/","providers.v1":"https://127.0.0.1:3000/providers/v1/"}",
"headers": {
"content-type": "application/json",
},
"statusCode": 200,
Expand Down
2 changes: 1 addition & 1 deletion template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Parameters:
#########
Globals:
Function:
Runtime: nodejs14.x
Runtime: nodejs18.x
MemorySize:
Ref: LambdaMemorySize
Timeout:
Expand Down
Loading