feat: cli launcher npx kandev (#39)

* feat: cli launcher

* feat: improved debug
This commit is contained in:
Carlos Florêncio
2026-01-18 20:42:03 +00:00
committed by GitHub
parent 16b3fb5b92
commit bc6a5f28d9
29 changed files with 1682 additions and 33 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# Used by .github/workflows/release.yml to package the Next.js standalone output.
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
WEB_DIR="$ROOT_DIR/apps/web"
OUT_DIR="$ROOT_DIR/dist/web"
echo "Packaging Next.js standalone output for release..."
if [ ! -d "$WEB_DIR/.next/standalone" ]; then
echo "Missing standalone output at $WEB_DIR/.next/standalone"
echo "Run: pnpm -C apps --filter @kandev/web build"
exit 1
fi
rm -rf "$OUT_DIR"
mkdir -p "$OUT_DIR"
cp -R "$WEB_DIR/.next/standalone/." "$OUT_DIR/"
mkdir -p "$OUT_DIR/.next"
cp -R "$WEB_DIR/.next/static" "$OUT_DIR/.next/"
if [ -d "$WEB_DIR/public" ]; then
cp -R "$WEB_DIR/public" "$OUT_DIR/public"
fi
echo "Web bundle packaged at $OUT_DIR"
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Publish the npm launcher package (apps/cli) with a specific version.
# Usage: scripts/release/publish-launcher.sh <version>
set -euo pipefail
if [ $# -lt 1 ]; then
echo "Usage: $0 <version>"
echo "Example: $0 0.1.2"
exit 1
fi
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
VERSION="$1"
if [[ "$VERSION" == v* ]]; then
VERSION="${VERSION#v}"
echo "Stripped leading 'v', using version $VERSION"
fi
echo "Updating launcher version to $VERSION..."
(cd "$ROOT_DIR/apps/cli" && npm version --no-git-tag-version "$VERSION")
ACTUAL_VERSION="$(node -p "require('./apps/cli/package.json').version")"
if [ "$ACTUAL_VERSION" != "$VERSION" ]; then
echo "Failed to set launcher version to $VERSION (found $ACTUAL_VERSION)."
exit 1
fi
echo "Installing workspace dependencies..."
pnpm -C "$ROOT_DIR/apps" install --frozen-lockfile
echo "Building launcher (TypeScript)..."
pnpm -C "$ROOT_DIR/apps/cli" build
echo "Publishing launcher to npm..."
(cd "$ROOT_DIR/apps/cli" && npm publish --access public)
echo "Done. This only published the npm CLI package."
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Tag and push a release version to trigger the GitHub Actions bundle build.
# Usage: scripts/release/publish-release.sh <version>
set -euo pipefail
if [ $# -lt 1 ]; then
echo "Usage: $0 <version>"
echo "Example: $0 0.1.2"
exit 1
fi
VERSION="$1"
LAUNCHER_VERSION="$(node -p "require('./apps/cli/package.json').version")"
if [ "$LAUNCHER_VERSION" != "$VERSION" ]; then
echo "Launcher version mismatch: apps/cli/package.json is $LAUNCHER_VERSION"
echo "Run scripts/release/publish-launcher.sh $VERSION first."
exit 1
fi
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "Tag v$VERSION already exists."
exit 1
fi
echo "Creating tag v$VERSION..."
git tag "v$VERSION"
echo "Pushing tag v$VERSION..."
git push origin "v$VERSION"
echo "Done. GitHub Actions will build and upload runtime bundles."