unified-tvdevelopment-cli 1.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,37 @@
1
+ # Release Process
2
+
3
+ ## Quick release
4
+
5
+ ```bash
6
+ npm version patch # or minor / major
7
+ git push origin main --follow-tags
8
+ ```
9
+
10
+ The `npm version` command:
11
+ 1. Updates `package.json` version
12
+ 2. Creates a git commit (`chore(release): vX.Y.Z`)
13
+ 3. Creates a git tag (`vX.Y.Z`)
14
+
15
+ Pushing the tag triggers the `release.yml` workflow which:
16
+ - Runs tests
17
+ - Validates tag matches `package.json`
18
+ - Publishes to npm
19
+ - Creates a GitHub Release
20
+
21
+ ## Pre-releases (beta)
22
+
23
+ ```bash
24
+ npm version prerelease --preid=beta # e.g. 1.0.1-beta.0
25
+ git push origin main --follow-tags
26
+ ```
27
+
28
+ Beta releases publish to npm with `--tag beta` and are marked as pre-release on GitHub.
29
+
30
+ ## Platform CLI dependencies
31
+
32
+ | Platform | Required tools |
33
+ |---|---|
34
+ | LG webOS | `npm install -g @webosose/ares-cli` |
35
+ | Samsung Tizen | Tizen Studio (tizen + sdb) |
36
+ | Amazon Fire TV | `adb` (Android Platform Tools) + `inputd-cli` + `LoggingCtl` |
37
+ | Android TV | Android SDK (`adb`, `gradle`, `avdmanager`, `emulator`) |
package/install.ps1 ADDED
@@ -0,0 +1,81 @@
1
+ # unified-tvdevelopment-cli — Windows installer
2
+ # Run: iwr -useb https://raw.githubusercontent.com/FernandoHaeser/unified-tvdevelopment-cli/main/install.ps1 | iex
3
+
4
+ $ErrorActionPreference = 'Stop'
5
+ $Package = "unified-tvdevelopment-cli"
6
+ $Bin = "tvdev"
7
+
8
+ function Write-Banner {
9
+ Write-Host ""
10
+ Write-Host " [TV Dev Manager]" -ForegroundColor Cyan
11
+ Write-Host " Universal Smart TV Development CLI" -ForegroundColor DarkGray
12
+ Write-Host " LG webOS · Samsung Tizen · Amazon Fire TV · Android TV" -ForegroundColor DarkGray
13
+ Write-Host ""
14
+ }
15
+
16
+ function Write-Step { param($msg) Write-Host "`n > $msg" -ForegroundColor Cyan }
17
+ function Write-Ok { param($msg) Write-Host " [OK] $msg" -ForegroundColor Green }
18
+ function Write-Warn { param($msg) Write-Host " [!!] $msg" -ForegroundColor Yellow }
19
+ function Write-Fail { param($msg) Write-Host " [XX] $msg" -ForegroundColor Red; exit 1 }
20
+
21
+ Write-Banner
22
+
23
+ # Node.js
24
+ Write-Step "Checking Node.js"
25
+ try {
26
+ $nodeVer = (node --version 2>$null)
27
+ Write-Ok "Node.js $nodeVer"
28
+ } catch {
29
+ Write-Fail "Node.js not found. Install from https://nodejs.org"
30
+ }
31
+
32
+ # npm
33
+ Write-Step "Checking npm"
34
+ try {
35
+ $npmVer = (npm --version 2>$null)
36
+ Write-Ok "npm $npmVer"
37
+ } catch {
38
+ Write-Fail "npm not found."
39
+ }
40
+
41
+ # Install
42
+ Write-Step "Installing $Package"
43
+ npm install -g $Package
44
+ Write-Ok "$Package installed"
45
+
46
+ # Verify
47
+ Write-Step "Verifying"
48
+ try {
49
+ $binPath = (Get-Command $Bin -ErrorAction Stop).Path
50
+ Write-Ok "$Bin -> $binPath"
51
+ } catch {
52
+ Write-Warn "$Bin not found in PATH. You may need to restart your terminal."
53
+ }
54
+
55
+ # Platform tools check
56
+ Write-Step "Checking platform-specific tools"
57
+
58
+ if (Get-Command "ares-setup-device" -ErrorAction SilentlyContinue) {
59
+ Write-Ok "ares-cli (LG webOS) found"
60
+ } else {
61
+ Write-Warn "ares-cli not found. Install: npm install -g @webosose/ares-cli"
62
+ }
63
+
64
+ if (Get-Command "sdb" -ErrorAction SilentlyContinue) {
65
+ Write-Ok "sdb (Samsung Tizen) found"
66
+ } else {
67
+ Write-Warn "sdb not found. Install Tizen Studio from developer.samsung.com/smarttv"
68
+ }
69
+
70
+ if (Get-Command "adb" -ErrorAction SilentlyContinue) {
71
+ Write-Ok "adb (Amazon Fire TV / Android TV) found"
72
+ } else {
73
+ Write-Warn "adb not found. Install Android SDK Platform Tools"
74
+ }
75
+
76
+ Write-Host ""
77
+ Write-Host " Installation complete!" -ForegroundColor Green
78
+ Write-Host ""
79
+ Write-Host " Launch TV Dev Manager: " -NoNewline
80
+ Write-Host $Bin -ForegroundColor Cyan
81
+ Write-Host ""
package/install.sh ADDED
@@ -0,0 +1,194 @@
1
+ #!/usr/bin/env bash
2
+ # unified-tvdevelopment-cli — one-line installer
3
+ # Supports: LG webOS, Samsung Tizen, Amazon Fire TV, Android TV
4
+ #
5
+ # curl -fsSL https://raw.githubusercontent.com/FernandoHaeser/unified-tvdevelopment-cli/main/install.sh | bash
6
+ #
7
+ set -euo pipefail
8
+
9
+ PACKAGE="unified-tvdevelopment-cli"
10
+ BIN="tvdev"
11
+ REQUIRED_NODE=18
12
+ NVM_VERSION="v0.39.7"
13
+ INSTALL_NODE_VERSION="20"
14
+
15
+ if [ -t 1 ]; then
16
+ INDIGO='\033[38;5;99m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'
17
+ RED='\033[0;31m'; BOLD='\033[1m'; DIM='\033[2m'; RESET='\033[0m'
18
+ else
19
+ INDIGO=''; GREEN=''; YELLOW=''; RED=''; BOLD=''; DIM=''; RESET=''
20
+ fi
21
+
22
+ banner() {
23
+ echo ""
24
+ echo -e "${BOLD}${INDIGO} ◉ TV Dev Manager${RESET}"
25
+ echo -e " ${INDIGO}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
26
+ echo -e " ${DIM}Universal Smart TV Development CLI${RESET}"
27
+ echo -e " ${DIM}LG webOS · Samsung Tizen · Amazon Fire TV · Android TV${RESET}"
28
+ echo ""
29
+ }
30
+
31
+ step() { echo -e "\n${BOLD}${INDIGO} ▶ $*${RESET}"; }
32
+ ok() { echo -e " ${GREEN}✓${RESET} $*"; }
33
+ info() { echo -e " ${INDIGO}●${RESET} $*"; }
34
+ warn() { echo -e " ${YELLOW}⚠${RESET} $*"; }
35
+ skip() { echo -e " ${DIM}– $* (skipped)${RESET}"; }
36
+ fail() { echo -e "\n ${RED}✗ $*${RESET}\n"; exit 1; }
37
+
38
+ detect_shell_rc() {
39
+ case "${SHELL:-}" in
40
+ */zsh) echo "$HOME/.zshrc" ;;
41
+ */bash)
42
+ [ -f "$HOME/.bash_profile" ] && echo "$HOME/.bash_profile" || echo "$HOME/.bashrc"
43
+ ;;
44
+ */fish) echo "$HOME/.config/fish/config.fish" ;;
45
+ *) echo "$HOME/.profile" ;;
46
+ esac
47
+ }
48
+
49
+ idempotent_path_export() {
50
+ local bin_dir rc_file export_line
51
+ bin_dir=$(npm prefix -g 2>/dev/null)/bin
52
+ rc_file=$(detect_shell_rc)
53
+
54
+ if echo ":${PATH}:" | grep -q ":${bin_dir}:"; then
55
+ ok "PATH already contains npm global bin"
56
+ return
57
+ fi
58
+
59
+ if [[ "${SHELL:-}" == */fish ]]; then
60
+ export_line="set -gx PATH \$PATH ${bin_dir}"
61
+ else
62
+ export_line="export PATH=\"\$PATH:${bin_dir}\""
63
+ fi
64
+
65
+ if [ -f "$rc_file" ] && grep -qF "$bin_dir" "$rc_file" 2>/dev/null; then
66
+ ok "PATH entry already in ${rc_file}"
67
+ return
68
+ fi
69
+
70
+ echo "" >> "$rc_file"
71
+ echo "# added by unified-tvdevelopment-cli installer" >> "$rc_file"
72
+ echo "$export_line" >> "$rc_file"
73
+ ok "Added PATH entry to ${rc_file}"
74
+ export PATH="${PATH}:${bin_dir}"
75
+ }
76
+
77
+ # ── Idempotency ───────────────────────────────────────────────────────────────
78
+ banner
79
+
80
+ step "Checking existing installation"
81
+
82
+ if command -v "$BIN" &>/dev/null; then
83
+ INSTALLED_VER=$(npm list -g --depth=0 "$PACKAGE" 2>/dev/null \
84
+ | grep "$PACKAGE" | sed 's/.*@//' | tr -d '[:space:]' || true)
85
+ LATEST_VER=$(npm show "$PACKAGE" version 2>/dev/null || true)
86
+
87
+ ok "${BIN} already installed"
88
+ [ -n "$INSTALLED_VER" ] && info "Installed : ${INSTALLED_VER}"
89
+ [ -n "$LATEST_VER" ] && info "Latest : ${LATEST_VER}"
90
+
91
+ if [ -n "$INSTALLED_VER" ] && [ "$INSTALLED_VER" = "$LATEST_VER" ]; then
92
+ ok "Already up to date — nothing to do"
93
+ echo ""
94
+ echo -e " ${BOLD}Run: ${INDIGO}${BIN}${RESET}"
95
+ echo ""
96
+ exit 0
97
+ fi
98
+ else
99
+ info "${BIN} not yet installed — starting fresh install"
100
+ fi
101
+
102
+ # ── Node.js ───────────────────────────────────────────────────────────────────
103
+ step "Checking Node.js"
104
+
105
+ install_node_via_nvm() {
106
+ warn "Node.js not found — installing via nvm"
107
+ export NVM_DIR="${HOME}/.nvm"
108
+ curl -fsSL "https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh" | bash
109
+ [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
110
+ nvm install "$INSTALL_NODE_VERSION" --lts
111
+ nvm use "$INSTALL_NODE_VERSION"
112
+ nvm alias default "$INSTALL_NODE_VERSION"
113
+ ok "Node.js $(node --version) installed via nvm"
114
+ }
115
+
116
+ if ! command -v node &>/dev/null; then
117
+ NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
118
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
119
+ source "$NVM_DIR/nvm.sh"
120
+ if ! command -v node &>/dev/null; then nvm install "$INSTALL_NODE_VERSION" --lts && nvm use "$INSTALL_NODE_VERSION"; fi
121
+ else
122
+ install_node_via_nvm
123
+ fi
124
+ fi
125
+
126
+ ! command -v node &>/dev/null && fail "Node.js install failed. Install manually: https://nodejs.org"
127
+
128
+ NODE_MAJOR=$(node --version | sed 's/v//' | cut -d. -f1)
129
+ [ "$NODE_MAJOR" -lt "$REQUIRED_NODE" ] && fail "Node.js ${REQUIRED_NODE}+ required. Current: $(node --version)"
130
+
131
+ ok "Node.js $(node --version)"
132
+
133
+ # ── npm ───────────────────────────────────────────────────────────────────────
134
+ step "Checking npm"
135
+ ! command -v npm &>/dev/null && fail "npm not found."
136
+ ok "npm $(npm --version)"
137
+
138
+ # ── Install ───────────────────────────────────────────────────────────────────
139
+ step "Installing ${PACKAGE}"
140
+ info "Running: npm install -g ${PACKAGE}"
141
+ echo ""
142
+ npm install -g "$PACKAGE"
143
+ echo ""
144
+ ok "${PACKAGE} installed"
145
+
146
+ # ── PATH ──────────────────────────────────────────────────────────────────────
147
+ step "Setting up PATH"
148
+ idempotent_path_export
149
+ hash -r 2>/dev/null || true
150
+
151
+ if command -v "$BIN" &>/dev/null; then
152
+ ok "${BIN} is in PATH → $(command -v ${BIN})"
153
+ else
154
+ warn "${BIN} not in PATH for this session. Restart your terminal or:"
155
+ echo -e "\n ${BOLD}source $(detect_shell_rc)${RESET}\n"
156
+ fi
157
+
158
+ # ── Platform tools ────────────────────────────────────────────────────────────
159
+ step "Checking platform-specific tools"
160
+
161
+ if command -v ares-setup-device &>/dev/null; then
162
+ ok "ares-cli (LG webOS) → $(command -v ares-setup-device)"
163
+ else
164
+ warn "ares-cli not found. Install for webOS: npm install -g @webosose/ares-cli"
165
+ fi
166
+
167
+ if command -v sdb &>/dev/null; then
168
+ ok "sdb (Samsung Tizen) → $(command -v sdb)"
169
+ else
170
+ warn "sdb not found. Install Tizen Studio from developer.samsung.com/smarttv"
171
+ fi
172
+
173
+ if command -v adb &>/dev/null; then
174
+ ok "adb (Amazon Fire TV / Android TV) → $(command -v adb)"
175
+ else
176
+ warn "adb not found. Install: brew install android-platform-tools (macOS) or Android Studio SDK"
177
+ fi
178
+
179
+ if command -v inputd-cli &>/dev/null; then
180
+ ok "inputd-cli (Amazon Fire TV input) → $(command -v inputd-cli)"
181
+ else
182
+ warn "inputd-cli not found (optional — Amazon Fire TV remote input simulation)"
183
+ fi
184
+
185
+ # ── Done ──────────────────────────────────────────────────────────────────────
186
+ echo ""
187
+ echo -e "${BOLD}${INDIGO} ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
188
+ echo -e "${BOLD}${GREEN} ✓ Installation complete!${RESET}"
189
+ echo ""
190
+ echo -e " Launch TV Dev Manager: ${BOLD}${INDIGO}${BIN}${RESET}"
191
+ echo ""
192
+ echo -e " ${DIM}GitHub : https://github.com/FernandoHaeser/unified-tvdevelopment-cli${RESET}"
193
+ echo -e " ${DIM}npm : https://npmjs.com/package/unified-tvdevelopment-cli${RESET}"
194
+ echo ""
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "unified-tvdevelopment-cli",
3
+ "version": "1.0.1-beta.0",
4
+ "description": "Universal TUI manager for Smart TV development — LG webOS, Samsung Tizen, Amazon Fire TV, Android TV",
5
+ "type": "module",
6
+ "bin": {
7
+ "tvdev": "dist/cli.mjs"
8
+ },
9
+ "engines": {
10
+ "node": ">=18.0.0"
11
+ },
12
+ "scripts": {
13
+ "build": "mkdir -p dist && esbuild src/index.js --bundle --packages=external --platform=node --format=esm --outfile=dist/_bundle.mjs --loader:.js=jsx && printf '#!/usr/bin/env node\\n' | cat - dist/_bundle.mjs > dist/cli.mjs && chmod +x dist/cli.mjs && rm dist/_bundle.mjs",
14
+ "start": "npm run build && node dist/cli.mjs",
15
+ "dev": "npm run build && node dist/cli.mjs",
16
+ "prepare": "npm run build",
17
+ "test": "vitest run",
18
+ "test:unit": "vitest run tests/unit",
19
+ "test:integration": "vitest run tests/integration",
20
+ "test:e2e": "vitest run tests/e2e",
21
+ "test:watch": "vitest",
22
+ "test:coverage": "vitest run --coverage"
23
+ },
24
+ "keywords": [
25
+ "webos",
26
+ "tizen",
27
+ "android-tv",
28
+ "fire-tv",
29
+ "amazon",
30
+ "ares-cli",
31
+ "sdb",
32
+ "adb",
33
+ "tui",
34
+ "cli",
35
+ "smart-tv",
36
+ "lg",
37
+ "samsung"
38
+ ],
39
+ "license": "MIT",
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "https://github.com/FernandoHaeser/unified-tvdevelopment-cli"
43
+ },
44
+ "files": [
45
+ "dist/",
46
+ "install.sh",
47
+ "install.ps1",
48
+ "README.md",
49
+ "docs/"
50
+ ],
51
+ "dependencies": {
52
+ "chalk": "^5.3.0",
53
+ "execa": "^9.3.0",
54
+ "ink": "^5.0.1",
55
+ "ink-text-input": "^6.0.0",
56
+ "react": "^18.3.1"
57
+ },
58
+ "devDependencies": {
59
+ "@vitest/coverage-v8": "^2.1.9",
60
+ "esbuild": "^0.28.0",
61
+ "vitest": "^2.1.9"
62
+ }
63
+ }