diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index caa344065b..8e67999d1a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,6 +17,9 @@ "Vue.volar", "Vue.vscode-typescript-vue-plugin" ], + "features": { + "ghcr.io/devcontainers-contrib/features/pnpm:2": {} + }, // Connect as non-root user (https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user) "remoteUser": "node" } diff --git a/.gitpod.yml b/.gitpod.yml index 01625e0392..5639c37f97 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -9,6 +9,7 @@ ports: tasks: - name: Node.js init: ./scripts/setup.sh + command: nvm install vscode: extensions: diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..49991d30ce --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v18.14.0 diff --git a/scripts/setup.sh b/scripts/setup.sh index 80f2379377..00b6f9d087 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# [REQUIREMENTS] +# Need to install: docker, nvm, pnpm + set -ex BASEDIR=$(dirname $(dirname $(realpath $0))) @@ -33,15 +36,16 @@ echo "NODEMAILER_PASS=\"\"" >> backend/.env # Use docker-compose profile if [ -z $DEVCONTAINER ] then - docker-compose up -d + docker compose up -d fi jwt_secret=$(echo -n head /dev/urandom | LC_ALL=C tr -dc A-Za-z0-9 | sha256sum) echo "JWT_SECRET=$jwt_secret" >> backend/.env -# Install pnpm -pnpm --version || sudo corepack enable -corepack prepare pnpm@7.2.1 --activate +# Install Node.js +bash -i -c 'nvm install' + +# Install Node.js packages pnpm install # Install lefthook for git hook