diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..42b54e366 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,32 @@ +{ + "name": "Stlite", + "image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm", + "features": { + "ghcr.io/devcontainers/features/python:1": { + "installTools": true, + "version": "3.12.1" + }, + "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { + "packages": "make,protobuf-compiler,libprotobuf-dev" + } + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + "forwardPorts": [3000, 3030], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "/bin/bash ./.devcontainer/postCreateCommand.sh", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" + + "hostRequirements": { + "memory": "16gb", + "storage": "16gb" + } +} diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh new file mode 100644 index 000000000..1ac531738 --- /dev/null +++ b/.devcontainer/postCreateCommand.sh @@ -0,0 +1,10 @@ +make init + +REACT_APP_EDITOR_APP_ORIGIN="https://${CODESPACE_NAME}-3030.app.github.dev" +REACT_APP_SHARING_APP_URL="https://${CODESPACE_NAME}-3000.app.github.dev/" + +for file in ~/.zshrc ~/.bashrc; do + echo "" >> $file + echo "export REACT_APP_EDITOR_APP_ORIGIN=${REACT_APP_EDITOR_APP_ORIGIN}" >> $file + echo "export REACT_APP_SHARING_APP_URL=${REACT_APP_SHARING_APP_URL}" >> $file +done diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5c857bab3..dd899592e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,3 +12,7 @@ updates: directory: "/packages/kernel/py/stlite-lib" schedule: interval: "daily" + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/packages/sharing/package.json b/packages/sharing/package.json index 17b50784d..6babc93d9 100644 --- a/packages/sharing/package.json +++ b/packages/sharing/package.json @@ -22,7 +22,7 @@ "web-vitals": "^3.5.2" }, "scripts": { - "start": "cross-env REACT_APP_EDITOR_APP_ORIGIN=http://localhost:3030 BROWSER=none craco start", + "start": "cross-env REACT_APP_EDITOR_APP_ORIGIN=${REACT_APP_EDITOR_APP_ORIGIN:=http://localhost:3030} BROWSER=none craco start", "build": "craco build", "test": "craco test", "eject": "react-scripts eject"