From 5d2f458f360152c78495b6fd7df7029c6d5e84b3 Mon Sep 17 00:00:00 2001 From: thephez Date: Fri, 13 Mar 2026 15:19:20 -0400 Subject: [PATCH 1/4] chore: modernize devcontainer config for better DX Replace unused JSHint feature with ESLint/Prettier/DotENV extensions, switch to npm ci, auto-create .env from template, add VS Code settings, run as non-root user, and display onboarding steps on container start. Co-Authored-By: Claude Opus 4.6 --- .devcontainer/devcontainer.json | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9b4f578..4040c0f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,26 +1,27 @@ -// 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": "Tutorials", - "image": "mcr.microsoft.com/devcontainers/javascript-node:20", - "features": { - "ghcr.io/devcontainers-contrib/features/jshint:2": {} - }, + "name": "Dash Platform Tutorials", + "image": "mcr.microsoft.com/devcontainers/javascript-node:20", + "remoteUser": "node", - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + "onCreateCommand": "cp -n .env.example .env", + "postCreateCommand": "npm ci", + "postStartCommand": "echo '\\n=== Dash Platform Tutorials ===\\nNext steps:\\n 1. Verify connection: node connect.mjs\\n 2. Create a wallet: node create-wallet.mjs\\n 3. Edit .env with your mnemonic (PLATFORM_MNEMONIC)\\n 4. Start tutorials in 1-Identities-and-Names/\\n\\nSee README.md for details.\\n'", - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "npm install", - - // Configure tool-specific properties. "customizations": { - // Configure properties specific to VS Code. "vscode": { - // Add the IDs of extensions you want installed when the container is created. "extensions": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "mikestead.dotenv", "streetsidesoftware.code-spell-checker" - ] + ], + "settings": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.tabSize": 2, + "files.eol": "\n", + "files.trimTrailingWhitespace": true, + "files.insertFinalNewline": true + } } } } From f8f11111ee90e27549d5b6b7e0de47ccd1520bef Mon Sep 17 00:00:00 2001 From: thephez Date: Fri, 13 Mar 2026 15:43:46 -0400 Subject: [PATCH 2/4] docs: update readme with dev container section --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index b2a0595..5eda876 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,20 @@ site](http://docs.dash.org/projects/platform/en/stable/docs/tutorials/introducti uses `@dashevo/evo-sdk`. For the legacy `js-dash-sdk` tutorials, see [v2.0.1](https://github.com/dashpay/platform-tutorials/releases/tag/v2.0.1). +## Quick Start with Dev Containers + +[![Open in GitHub +Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/dashpay/platform-tutorials) + +The included dev container provides a ready-to-use environment with Node.js, dependencies, and +editor tooling pre-configured. Open the repo in [GitHub +Codespaces](https://codespaces.new/dashpay/platform-tutorials) or locally with the [VS Code Dev +Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). + +On first launch the container installs dependencies and creates a starter `.env` file from +`.env.example`. Run `node create-wallet.mjs` to generate a mnemonic, then set `PLATFORM_MNEMONIC` +in your `.env` file to begin the tutorials. + ## Install Note: [NodeJS](https://nodejs.org/en/download/) (v20+) must be installed to run the tutorial code. From f2f22446c3e6b4ec31d42c5788ee9e326ac43fe0 Mon Sep 17 00:00:00 2001 From: thephez Date: Sat, 14 Mar 2026 13:52:25 -0400 Subject: [PATCH 3/4] fix: use postattachcommand so message is shown to user on startup --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4040c0f..eb0b963 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,7 @@ "onCreateCommand": "cp -n .env.example .env", "postCreateCommand": "npm ci", - "postStartCommand": "echo '\\n=== Dash Platform Tutorials ===\\nNext steps:\\n 1. Verify connection: node connect.mjs\\n 2. Create a wallet: node create-wallet.mjs\\n 3. Edit .env with your mnemonic (PLATFORM_MNEMONIC)\\n 4. Start tutorials in 1-Identities-and-Names/\\n\\nSee README.md for details.\\n'", + "postAttachCommand": "echo '\\n=== Dash Platform Tutorials ===\\nNext steps:\\n 1. Verify connection: node connect.mjs\\n 2. Create a wallet: node create-wallet.mjs\\n 3. Edit .env with your mnemonic (PLATFORM_MNEMONIC)\\n 4. Start tutorials in 1-Identities-and-Names/\\n\\nSee README.md for details.\\n'", "customizations": { "vscode": { From 0c2bd9ab0c0d04dcfc43e0e606c016d9ad8b9551 Mon Sep 17 00:00:00 2001 From: thephez Date: Sat, 14 Mar 2026 14:02:51 -0400 Subject: [PATCH 4/4] chore: move welcome message to script with docs link Co-Authored-By: Claude Opus 4.6 --- .devcontainer/devcontainer.json | 2 +- .devcontainer/welcome.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100755 .devcontainer/welcome.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index eb0b963..4b9b364 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,7 @@ "onCreateCommand": "cp -n .env.example .env", "postCreateCommand": "npm ci", - "postAttachCommand": "echo '\\n=== Dash Platform Tutorials ===\\nNext steps:\\n 1. Verify connection: node connect.mjs\\n 2. Create a wallet: node create-wallet.mjs\\n 3. Edit .env with your mnemonic (PLATFORM_MNEMONIC)\\n 4. Start tutorials in 1-Identities-and-Names/\\n\\nSee README.md for details.\\n'", + "postAttachCommand": ".devcontainer/welcome.sh", "customizations": { "vscode": { diff --git a/.devcontainer/welcome.sh b/.devcontainer/welcome.sh new file mode 100755 index 0000000..73a0838 --- /dev/null +++ b/.devcontainer/welcome.sh @@ -0,0 +1,2 @@ +#!/bin/sh +printf '\n=== Dash Platform Tutorials ===\n\nNext steps:\n 1. Verify connection: node connect.mjs\n 2. Create a wallet: node create-wallet.mjs\n 3. Edit .env with your mnemonic (PLATFORM_MNEMONIC)\n 4. Start tutorials in 1-Identities-and-Names/\n\nDocs: https://docs.dash.org/projects/platform/en/stable/docs/tutorials/introduction.html\n\n'