@bobfrankston/lxlan 0.1.7 → 0.1.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/release-all.ps1 +168 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/lxlan",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "LIFX LAN protocol library for device control via UDP",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -0,0 +1,168 @@
1
+ #!/usr/bin/env pwsh
2
+ # Release all LIFX packages in dependency order
3
+ # Automatically handles missing git remotes and GitHub repositories
4
+
5
+ $ErrorActionPreference = "Stop"
6
+
7
+ # Suppress npm color output
8
+ $env:NO_COLOR = "1"
9
+ $env:FORCE_COLOR = "0"
10
+ $env:NPM_CONFIG_COLOR = "false"
11
+
12
+ # Function to ensure git remote and GitHub repo exist
13
+ function Ensure-GitRemote {
14
+ param(
15
+ [string]$RepoPath,
16
+ [string]$RepoName,
17
+ [string]$Owner = "BobFrankston"
18
+ )
19
+
20
+ Push-Location $RepoPath
21
+
22
+ # Check if remote exists
23
+ $remote = git remote 2>$null
24
+
25
+ if (-not $remote -or $remote -notcontains "origin") {
26
+ Write-Host " → Setting up git remote..." -ForegroundColor Yellow
27
+ $remoteUrl = "https://github.com/$Owner/$RepoName.git"
28
+ git remote add origin $remoteUrl 2>$null
29
+ Write-Host " ✓ Added remote: $remoteUrl" -ForegroundColor Green
30
+ }
31
+
32
+ # Check if GitHub repo exists, create if needed
33
+ $repoExists = gh repo view "$Owner/$RepoName" 2>$null
34
+ if ($LASTEXITCODE -ne 0) {
35
+ Write-Host " → Creating GitHub repository..." -ForegroundColor Yellow
36
+ $desc = "Part of LIFX LAN control suite"
37
+ gh repo create "$Owner/$RepoName" --public --description $desc
38
+ if ($LASTEXITCODE -eq 0) {
39
+ Write-Host " ✓ Repository created!" -ForegroundColor Green
40
+ } else {
41
+ Write-Host " ✗ Failed to create repository" -ForegroundColor Red
42
+ Pop-Location
43
+ exit 1
44
+ }
45
+ }
46
+
47
+ # Check if upstream is set
48
+ $upstreamBranch = git rev-parse --abbrev-ref --symbolic-full-name '@{u}' 2>$null
49
+ if (-not $upstreamBranch) {
50
+ Write-Host " → Setting upstream branch..." -ForegroundColor Yellow
51
+ git push --set-upstream origin master 2>&1 | Out-Null
52
+ if ($LASTEXITCODE -eq 0) {
53
+ Write-Host " ✓ Upstream branch set" -ForegroundColor Green
54
+ }
55
+ }
56
+
57
+ Pop-Location
58
+ }
59
+
60
+ Write-Host ""
61
+ Write-Host "=== Releasing LIFX Packages ===" -ForegroundColor Cyan
62
+ Write-Host ""
63
+
64
+ # Base packages (no dependencies on each other)
65
+ Write-Host ">>> Releasing hlib..." -ForegroundColor Yellow
66
+ Ensure-GitRemote -RepoPath "y:\dev\homecontrol\utils\hlib" -RepoName "hlib"
67
+ Set-Location "y:\dev\homecontrol\utils\hlib"
68
+ npm run release
69
+ if ($LASTEXITCODE -ne 0) {
70
+ Write-Host "ERROR: hlib release failed" -ForegroundColor Red
71
+ exit 1
72
+ }
73
+ Write-Host ""
74
+
75
+ Write-Host ">>> Releasing rmfudp..." -ForegroundColor Yellow
76
+ Ensure-GitRemote -RepoPath "y:\dev\homecontrol\utils\rmfudp" -RepoName "rmfudp"
77
+ Set-Location "y:\dev\homecontrol\utils\rmfudp"
78
+ npm run release
79
+ if ($LASTEXITCODE -ne 0) {
80
+ Write-Host "ERROR: rmfudp release failed" -ForegroundColor Red
81
+ exit 1
82
+ }
83
+ Write-Host ""
84
+
85
+ Write-Host ">>> Releasing colorlib..." -ForegroundColor Yellow
86
+ Ensure-GitRemote -RepoPath "y:\dev\homecontrol\utils\colorlib" -RepoName "colorlib"
87
+ Set-Location "y:\dev\homecontrol\utils\colorlib"
88
+ npm run release
89
+ if ($LASTEXITCODE -ne 0) {
90
+ Write-Host "ERROR: colorlib release failed" -ForegroundColor Red
91
+ exit 1
92
+ }
93
+ Write-Host ""
94
+
95
+ Write-Host ">>> Releasing lxlan..." -ForegroundColor Yellow
96
+ Ensure-GitRemote -RepoPath "y:\dev\homecontrol\Others\LifX\Apps\lxlan" -RepoName "lxlan"
97
+ Set-Location "y:\dev\homecontrol\Others\LifX\Apps\lxlan"
98
+ npm run release
99
+ if ($LASTEXITCODE -ne 0) {
100
+ Write-Host "ERROR: lxlan release failed" -ForegroundColor Red
101
+ exit 1
102
+ }
103
+ Write-Host ""
104
+
105
+ # Update dependencies after base packages
106
+ Write-Host ">>> Updating lxlan-node dependencies..." -ForegroundColor Yellow
107
+ Ensure-GitRemote -RepoPath "y:\dev\homecontrol\Others\LifX\Apps\lxlan-node" -RepoName "lxlan-node"
108
+ Set-Location "y:\dev\homecontrol\Others\LifX\Apps\lxlan-node"
109
+ npm install
110
+ if ($LASTEXITCODE -ne 0) {
111
+ Write-Host "ERROR: lxlan-node npm install failed" -ForegroundColor Red
112
+ exit 1
113
+ }
114
+
115
+ Write-Host ">>> Releasing lxlan-node..." -ForegroundColor Yellow
116
+ npm run release
117
+ if ($LASTEXITCODE -ne 0) {
118
+ Write-Host "ERROR: lxlan-node release failed" -ForegroundColor Red
119
+ exit 1
120
+ }
121
+ Write-Host ""
122
+
123
+ # Update lifxer dependencies
124
+ Write-Host ">>> Updating lifxer dependencies..." -ForegroundColor Yellow
125
+ Ensure-GitRemote -RepoPath "y:\dev\homecontrol\Others\LifX\Apps\lifxer" -RepoName "lifxer"
126
+ Set-Location "y:\dev\homecontrol\Others\LifX\Apps\lifxer"
127
+ npm install
128
+ if ($LASTEXITCODE -ne 0) {
129
+ Write-Host "ERROR: lifxer npm install failed" -ForegroundColor Red
130
+ exit 1
131
+ }
132
+
133
+ Write-Host ">>> Releasing lifxer..." -ForegroundColor Yellow
134
+ npm run release
135
+ if ($LASTEXITCODE -ne 0) {
136
+ Write-Host "ERROR: lifxer release failed" -ForegroundColor Red
137
+ exit 1
138
+ }
139
+ Write-Host ""
140
+
141
+ # lxtest
142
+ Write-Host ">>> Updating lxtest dependencies..." -ForegroundColor Yellow
143
+ Ensure-GitRemote -RepoPath "y:\dev\homecontrol\Others\LifX\Apps\lxtest" -RepoName "lxtest"
144
+ Set-Location "y:\dev\homecontrol\Others\LifX\Apps\lxtest"
145
+ npm install
146
+ if ($LASTEXITCODE -ne 0) {
147
+ Write-Host "ERROR: lxtest npm install failed" -ForegroundColor Red
148
+ exit 1
149
+ }
150
+
151
+ Write-Host ">>> Releasing lxtest..." -ForegroundColor Yellow
152
+ npm run release
153
+ if ($LASTEXITCODE -ne 0) {
154
+ Write-Host "ERROR: lxtest release failed" -ForegroundColor Red
155
+ exit 1
156
+ }
157
+ Write-Host ""
158
+
159
+ Write-Host "=== All releases completed successfully! ===" -ForegroundColor Green
160
+ Write-Host ""
161
+ Write-Host "Released packages:"
162
+ Write-Host " - @bobfrankston/hlib"
163
+ Write-Host " - @bobfrankston/rmfudp"
164
+ Write-Host " - @bobfrankston/colorlib"
165
+ Write-Host " - @bobfrankston/lxlan"
166
+ Write-Host " - @bobfrankston/lxlan-node"
167
+ Write-Host " - @bobfrankston/lifxer"
168
+ Write-Host " - lxtest"