-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from moreal/devcontainer
Introduce devcontainer
- Loading branch information
Showing
3 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Run codegen | ||
deno task -c src/deno.json codegen | ||
deno task -c cli/deno.json codegen | ||
|
||
# .bashrc doesn't work when creating a new container. | ||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | ||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | ||
export PATH="$PATH:$HOME/.bun/bin" | ||
|
||
echo | ||
echo "INFO: Tool version" | ||
echo "node: $(node -v)" | ||
deno -v | ||
echo "bun: $(bun -v)" | ||
echo "pnpm: $(pnpm -v)" | ||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
export BUN_VERSION="v1.1.29" | ||
export NODE_VERSION="20" | ||
export NVM_VERSION="v0.40.0" | ||
export PNPM_VERSION="9.11.0" | ||
|
||
# Setup deno completions | ||
mkdir -p /usr/local/etc/bash_completion.d/ | ||
deno completions bash > /usr/local/etc/bash_completion.d/deno.bash | ||
|
||
cat << EOF >> ~/.bashrc | ||
source /usr/local/etc/bash_completion.d/deno.bash | ||
EOF | ||
|
||
apt update | ||
apt upgrade -y | ||
|
||
apt install -y git curl unzip vim | ||
|
||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh | bash | ||
|
||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | ||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | ||
|
||
nvm install "$NODE_VERSION" | ||
|
||
corepack enable | ||
corepack install -g "pnpm@$PNPM_VERSION" | ||
|
||
curl -fsSL https://bun.sh/install | bash -s "bun-$BUN_VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node | ||
{ | ||
"name": "Development Environment", | ||
"image": "denoland/deno:ubuntu-1.46.3", | ||
"postCreateCommand": ".devcontainer/bin/postCreateCommand.sh", | ||
"postAttachCommand": ".devcontainer/bin/postAttachCommand.sh", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"denoland.vscode-deno", | ||
"redhat.vscode-yaml", | ||
"streetsidesoftware.code-spell-checker" | ||
] | ||
} | ||
} | ||
} |