refactor: move fly TS into cli/src/fly/, add build-clouds.sh (#1604)

Move all fly TypeScript files from fly/lib/*.ts and fly/main.ts into
cli/src/fly/. This gives them access to cli/node_modules (@clack/prompts),
biome linting, and the existing bun:test infrastructure — no symlinks or
NODE_PATH hacks needed.

The org picker now uses @clack/prompts select() directly (static import,
bundled at build time).

New: cli/build-clouds.sh — auto-discovers cli/src/*/main.ts and bundles
each into {cloud}.js. Scalable to future cloud TS migrations:
  bash cli/build-clouds.sh        # build all
  bash cli/build-clouds.sh fly    # build one

Shims now check for cli/src/fly/main.ts (local) or download fly.js from
GitHub releases (remote curl|bash).

Co-authored-by: lab <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
A 2026-02-21 12:34:09 -08:00 committed by GitHub
parent 14fb352b52
commit 262d081756
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 375 additions and 329 deletions

View file

@ -28,6 +28,9 @@ jobs:
bun install
bun run build
- name: Build cloud bundles
run: bun run cli/build-clouds.ts
- name: Get version
id: version
working-directory: cli
@ -53,3 +56,27 @@ jobs:
**Built:** $(date -u +%Y-%m-%dT%H:%M:%SZ)" \
--prerelease \
cli/cli.js
- name: Upload cloud bundles
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Upload each cloud bundle as a separate release (fly-latest/fly.js, etc.)
for bundle in cli/*.js; do
name=$(basename "$bundle" .js)
[[ "$name" == "cli" ]] && continue # skip cli.js, already uploaded above
gh release delete "${name}-latest" --yes 2>/dev/null || true
git tag -d "${name}-latest" 2>/dev/null || true
git push origin ":refs/tags/${name}-latest" 2>/dev/null || true
gh release create "${name}-latest" \
--title "${name} bundle v${{ steps.version.outputs.version }}" \
--notes "Pre-built ${name} cloud provider bundle.
Downloaded by \`${name}/*.sh\` shims for \`bash <(curl ...)\` execution.
**Built:** $(date -u +%Y-%m-%dT%H:%M:%SZ)" \
--prerelease \
"$bundle"
done