diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 05a154cfb8..2b9bb75504 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update \ curl \ uuid-runtime \ && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/lib/elide \ + && mkdir -p /usr/lib/elide /home/vscode/.elide \ && echo "Installing Elide..." \ && curl -sSL elide.sh | bash -s - --install-dir=/usr/lib/elide \ && ln -s /usr/lib/elide/elide /bin/elide \ diff --git a/.devcontainer/README.md b/.devcontainer/README.md index c2fc385ee6..c2df53f588 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -1,6 +1,6 @@
@@ -10,32 +10,60 @@ This GitHub Codespace comes pre-installed with the latest version of [Elide](htt ## Stuff to try -**To see available commands:** -``` -elide --help -``` +**Your terminal should already be open at the bottom of your screen.** We have already taken care of running the first command, `elide --help`, for you. Here's some more stuff you can try. + +### Basic commands **To see runtime info:** ``` elide info ``` +**To verify working installation:** +``` +elide selftest +``` + +### JavaScript + **To run a JavaScript terminal:** ``` elide shell ``` +**Encode some JSON:** +```javascript +JSON.stringify({x: 5}) +``` + +**To see `.env` environment:** +```python +JSON.stringify(process.env) +``` + +**Generate a UUID:** +```javascript +crypto.randomUUID()+"" +``` + +**Parse a URL and print the host:** +```javascript +new URL("https://google.com").host +``` + **To run a JavaScript server:** ``` elide serve tools/scripts/server.js ``` +### Python + **To run a Python terminal:** ``` elide shell --python ``` -**To verify working installation:** -``` -elide selftest +**To see `.env` environment:** +```python +import os; os.environ ``` diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d317f39789..ccc054f57c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,7 +4,7 @@ "dockerfile": "Dockerfile" }, "runArgs": ["--init", "--privileged"], - "postAttachCommand": "code .devcontainer/README.md && elide --help", + "postAttachCommand": "echo 'ELIDE_CODESPACE=true' > .env && touch package.json && code .devcontainer/README.md && clear && elide --help", "overrideCommand": false, "features": { "ghcr.io/devcontainers/features/git:1": {},