Skip to content

Commit 8c47d37

Browse files
Sebastien Chopinampagent
andcommitted
chore: add Amp orb setup script
Installs the pinned pnpm, dependencies, and runs dev:prepare so fresh orbs start ready. Amp-Thread-ID: https://ampcode.com/threads/T-01a1686c-0d01-731b-9da7-773ec68f49ed Co-authored-by: Amp <amp@ampcode.com>
1 parent 14d22b2 commit 8c47d37

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

‎.agents/setup‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
# Prepares an Amp orb for this repository: pinned pnpm, dependencies, and stubbed module build.
3+
set -euo pipefail
4+
5+
cd "$(dirname "${BASH_SOURCE[0]}")/.."
6+
7+
step() {
8+
local name="$1"
9+
shift
10+
echo "==> $name"
11+
local start=$SECONDS
12+
"$@"
13+
echo "<== $name ($((SECONDS - start))s)"
14+
}
15+
16+
ensure_pnpm() {
17+
local wanted
18+
wanted="$(node -p "require('./package.json').packageManager.split('@')[1]")"
19+
if [[ "$(pnpm --version 2>/dev/null || true)" != "$wanted" ]]; then
20+
npm install --global --no-fund --no-audit "pnpm@$wanted"
21+
fi
22+
pnpm --version
23+
}
24+
25+
step "pnpm" ensure_pnpm
26+
step "pnpm install" pnpm install --frozen-lockfile --prefer-offline
27+
step "dev:prepare" pnpm run dev:prepare

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ Temporary Items
5353

5454
.data
5555
playgrounds/nuxt/.data
56+
57+
# Amp
58+
.amp/portals/*

0 commit comments

Comments
 (0)