Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .devcontainer/arduino/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"version": "lts"
}
},
"onCreateCommand": "pipx install platformio && node scripts/prepare-demo.mjs arduino",
"onCreateCommand": "pipx install platformio && node scripts/prepare-demo.mjs arduino && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/arduino",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -20,6 +21,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/cargo/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"version": "lts"
}
},
"onCreateCommand": "node scripts/prepare-demo.mjs cargo",
"onCreateCommand": ".devcontainer/cargo/setup.sh && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/cargo",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -20,6 +21,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand Down
26 changes: 26 additions & 0 deletions .devcontainer/cargo/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Creation-time setup for the Rust demo Codespace.
#
# Drift's Rust surface diff shells out to `cargo public-api`, which reads
# rustdoc's unstable JSON output and so needs the nightly toolchain. Drift will
# install both itself on first analysis (`tools.autoInstall` defaults to true),
# but `cargo install cargo-public-api` compiles from source — several minutes
# with the Drift panel apparently frozen. Doing it here moves that wait into
# the Codespace build, where it belongs.
#
# cargo-public-api is pinned; the nightly channel is not, matching what Drift's
# own auto-install does (`rustup toolchain install nightly --profile minimal`).
set -euo pipefail

CARGO_PUBLIC_API_VERSION="0.52.0"

echo "==> Installing nightly toolchain (required by cargo public-api)"
rustup toolchain install nightly --profile minimal

echo "==> Installing cargo-public-api $CARGO_PUBLIC_API_VERSION"
cargo install cargo-public-api --locked --version "$CARGO_PUBLIC_API_VERSION"

echo "==> Preparing the Rust demo"
node scripts/prepare-demo.mjs cargo

echo "==> Rust demo ready"
4 changes: 3 additions & 1 deletion .devcontainer/cocoapods/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"version": "lts"
}
},
"onCreateCommand": "gem install cocoapods --no-document && node scripts/prepare-demo.mjs cocoapods",
"onCreateCommand": "gem install cocoapods --no-document && node scripts/prepare-demo.mjs cocoapods && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/cocoapods",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -20,6 +21,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/conan/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"version": "lts"
}
},
"onCreateCommand": "pipx install conan && node scripts/prepare-demo.mjs conan",
"onCreateCommand": "pipx install conan && node scripts/prepare-demo.mjs conan && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/conan",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -20,6 +21,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/go/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"version": "lts"
}
},
"onCreateCommand": "node scripts/prepare-demo.mjs go",
"onCreateCommand": "node scripts/prepare-demo.mjs go && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/go",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -20,6 +21,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"drift.analysis.includePatch": true,
"files.exclude": {
"demos/npm": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/hex/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
},
"ghcr.io/devcontainers/features/git:1": {}
},
"onCreateCommand": "node scripts/prepare-demo.mjs hex",
"onCreateCommand": "node scripts/prepare-demo.mjs hex && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/hex",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -21,6 +22,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/maven/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
"installMaven": true
}
},
"onCreateCommand": "node scripts/prepare-demo.mjs maven",
"onCreateCommand": "node scripts/prepare-demo.mjs maven && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/maven",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -24,6 +25,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/npm/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
{
"name": "Drift demo — JavaScript / TypeScript",
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm",
"onCreateCommand": "node scripts/prepare-demo.mjs npm && npm --prefix demos/npm install --no-audit --no-fund",
"onCreateCommand": "node scripts/prepare-demo.mjs npm && npm --prefix demos/npm install --no-audit --no-fund && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/npm",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -15,6 +16,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/pypi": true,
"demos/go": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/nuget/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"version": "lts"
}
},
"onCreateCommand": "node scripts/prepare-demo.mjs nuget",
"onCreateCommand": "node scripts/prepare-demo.mjs nuget && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/nuget",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -20,6 +21,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/opam/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"version": "lts"
}
},
"onCreateCommand": "node scripts/prepare-demo.mjs opam",
"onCreateCommand": "node scripts/prepare-demo.mjs opam && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/opam",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -20,6 +21,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/packagist/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"version": "lts"
}
},
"onCreateCommand": "node scripts/prepare-demo.mjs packagist",
"onCreateCommand": "node scripts/prepare-demo.mjs packagist && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/packagist",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -20,6 +21,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/pub/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
},
"ghcr.io/devcontainers/features/git:1": {}
},
"onCreateCommand": "node scripts/prepare-demo.mjs pub",
"onCreateCommand": "node scripts/prepare-demo.mjs pub && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/pub",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -21,6 +22,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/pypi/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"version": "lts"
}
},
"onCreateCommand": "node scripts/prepare-demo.mjs pypi",
"onCreateCommand": "node scripts/prepare-demo.mjs pypi && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/pypi",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -20,6 +21,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/go": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/rubygems/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"version": "lts"
}
},
"onCreateCommand": "node scripts/prepare-demo.mjs rubygems",
"onCreateCommand": "node scripts/prepare-demo.mjs rubygems && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/rubygems",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -20,6 +21,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand Down
4 changes: 3 additions & 1 deletion .devcontainer/swift/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
},
"ghcr.io/devcontainers/features/git:1": {}
},
"onCreateCommand": "node scripts/prepare-demo.mjs swift",
"onCreateCommand": "node scripts/prepare-demo.mjs swift && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/swift",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -21,6 +22,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand Down
6 changes: 4 additions & 2 deletions .devcontainer/vcpkg/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"version": "lts"
}
},
"onCreateCommand": "node scripts/prepare-demo.mjs vcpkg",
"onCreateCommand": "node scripts/prepare-demo.mjs vcpkg && npm install -g @usedrift/cli",
"waitFor": "onCreateCommand",
"postAttachCommand": "drift analyze --dir demos/vcpkg",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -20,6 +21,7 @@
"settings": {
"drift.session.mode": "ask",
"drift.analysis.runOnStartup": true,
"drift.ui.openOnStartup": true,
"files.exclude": {
"demos/npm": true,
"demos/pypi": true,
Expand All @@ -42,7 +44,7 @@
"codespaces": {
"openFiles": [
"demos/vcpkg/DEMO.md",
"demos/vcpkg/src/main.cpp",
"demos/vcpkg/src/tests.cpp",
"demos/vcpkg/vcpkg.json"
]
}
Expand Down
Loading