From f42670ceac946e6d302a1d922cadcc638530f4de Mon Sep 17 00:00:00 2001 From: Steven Clontz Date: Tue, 23 May 2023 20:48:15 +0000 Subject: [PATCH] add devcontainer and update README for push-button dev environment --- .devcontainer/devcontainer.json | 28 ++++++++++++++++++++++++++++ README.md | 17 +++++++++++++++-- src/test/.testCode.doenet | 7 +++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 src/test/.testCode.doenet diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..8a1f895b3 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,28 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node +{ + "name": "Node.js", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/javascript-node:0-20", + "features": { + "ghcr.io/devcontainers/features/rust:1": {} + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && npm install && npm run compile-wasm && cp ./src/test/.testCode.doenet ./src/test/testCode.doenet", + "postAttachCommand": { + "viewer": "npm run dev -- --host" + } + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/README.md b/README.md index fb27e6a72..ab161654e 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,11 @@ Semantic markup for building interactive web activities. ## Quickstart + +First, install [Node](https://nodejs.org/en/download), +[Rust](https://rustup.rs/), +and [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/). + In the project folder: `$ npm install` @@ -25,9 +30,17 @@ In the project folder: `$ npm run dev` -Paste demo code into `src/test/testCode.doenet` +Paste demo code into `./src/test/testCode.doenet` +(or copy `./src/test/.testCode.doenet` to `./src/test/testCode.doenet`). + +Navigate to + +## Codespaces quickstart -Navigate to `localhost:3000/src/test/index.html` +All the above steps should happen automatically. Once that is ready +(after "Your applicaiton running on port 3000 is available"), +just visit (may need to +Ctrl-click to open GitHub Codespaces link). ## Demos diff --git a/src/test/.testCode.doenet b/src/test/.testCode.doenet new file mode 100644 index 000000000..f5ac278c1 --- /dev/null +++ b/src/test/.testCode.doenet @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file