@bobfrankston/lxlan 0.1.6 → 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.
- package/package.json +1 -1
- package/release-all.ps1 +63 -5
- package/release-all.bat +0 -113
package/package.json
CHANGED
package/release-all.ps1
CHANGED
|
@@ -1,17 +1,69 @@
|
|
|
1
1
|
#!/usr/bin/env pwsh
|
|
2
2
|
# Release all LIFX packages in dependency order
|
|
3
|
-
#
|
|
3
|
+
# Automatically handles missing git remotes and GitHub repositories
|
|
4
4
|
|
|
5
5
|
$ErrorActionPreference = "Stop"
|
|
6
6
|
|
|
7
|
-
# Suppress npm color output
|
|
7
|
+
# Suppress npm color output
|
|
8
8
|
$env:NO_COLOR = "1"
|
|
9
|
+
$env:FORCE_COLOR = "0"
|
|
10
|
+
$env:NPM_CONFIG_COLOR = "false"
|
|
9
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 ""
|
|
10
61
|
Write-Host "=== Releasing LIFX Packages ===" -ForegroundColor Cyan
|
|
11
62
|
Write-Host ""
|
|
12
63
|
|
|
13
64
|
# Base packages (no dependencies on each other)
|
|
14
65
|
Write-Host ">>> Releasing hlib..." -ForegroundColor Yellow
|
|
66
|
+
Ensure-GitRemote -RepoPath "y:\dev\homecontrol\utils\hlib" -RepoName "hlib"
|
|
15
67
|
Set-Location "y:\dev\homecontrol\utils\hlib"
|
|
16
68
|
npm run release
|
|
17
69
|
if ($LASTEXITCODE -ne 0) {
|
|
@@ -21,6 +73,7 @@ if ($LASTEXITCODE -ne 0) {
|
|
|
21
73
|
Write-Host ""
|
|
22
74
|
|
|
23
75
|
Write-Host ">>> Releasing rmfudp..." -ForegroundColor Yellow
|
|
76
|
+
Ensure-GitRemote -RepoPath "y:\dev\homecontrol\utils\rmfudp" -RepoName "rmfudp"
|
|
24
77
|
Set-Location "y:\dev\homecontrol\utils\rmfudp"
|
|
25
78
|
npm run release
|
|
26
79
|
if ($LASTEXITCODE -ne 0) {
|
|
@@ -30,6 +83,7 @@ if ($LASTEXITCODE -ne 0) {
|
|
|
30
83
|
Write-Host ""
|
|
31
84
|
|
|
32
85
|
Write-Host ">>> Releasing colorlib..." -ForegroundColor Yellow
|
|
86
|
+
Ensure-GitRemote -RepoPath "y:\dev\homecontrol\utils\colorlib" -RepoName "colorlib"
|
|
33
87
|
Set-Location "y:\dev\homecontrol\utils\colorlib"
|
|
34
88
|
npm run release
|
|
35
89
|
if ($LASTEXITCODE -ne 0) {
|
|
@@ -39,6 +93,7 @@ if ($LASTEXITCODE -ne 0) {
|
|
|
39
93
|
Write-Host ""
|
|
40
94
|
|
|
41
95
|
Write-Host ">>> Releasing lxlan..." -ForegroundColor Yellow
|
|
96
|
+
Ensure-GitRemote -RepoPath "y:\dev\homecontrol\Others\LifX\Apps\lxlan" -RepoName "lxlan"
|
|
42
97
|
Set-Location "y:\dev\homecontrol\Others\LifX\Apps\lxlan"
|
|
43
98
|
npm run release
|
|
44
99
|
if ($LASTEXITCODE -ne 0) {
|
|
@@ -49,6 +104,7 @@ Write-Host ""
|
|
|
49
104
|
|
|
50
105
|
# Update dependencies after base packages
|
|
51
106
|
Write-Host ">>> Updating lxlan-node dependencies..." -ForegroundColor Yellow
|
|
107
|
+
Ensure-GitRemote -RepoPath "y:\dev\homecontrol\Others\LifX\Apps\lxlan-node" -RepoName "lxlan-node"
|
|
52
108
|
Set-Location "y:\dev\homecontrol\Others\LifX\Apps\lxlan-node"
|
|
53
109
|
npm install
|
|
54
110
|
if ($LASTEXITCODE -ne 0) {
|
|
@@ -66,6 +122,7 @@ Write-Host ""
|
|
|
66
122
|
|
|
67
123
|
# Update lifxer dependencies
|
|
68
124
|
Write-Host ">>> Updating lifxer dependencies..." -ForegroundColor Yellow
|
|
125
|
+
Ensure-GitRemote -RepoPath "y:\dev\homecontrol\Others\LifX\Apps\lifxer" -RepoName "lifxer"
|
|
69
126
|
Set-Location "y:\dev\homecontrol\Others\LifX\Apps\lifxer"
|
|
70
127
|
npm install
|
|
71
128
|
if ($LASTEXITCODE -ne 0) {
|
|
@@ -81,8 +138,9 @@ if ($LASTEXITCODE -ne 0) {
|
|
|
81
138
|
}
|
|
82
139
|
Write-Host ""
|
|
83
140
|
|
|
84
|
-
# lxtest
|
|
141
|
+
# lxtest
|
|
85
142
|
Write-Host ">>> Updating lxtest dependencies..." -ForegroundColor Yellow
|
|
143
|
+
Ensure-GitRemote -RepoPath "y:\dev\homecontrol\Others\LifX\Apps\lxtest" -RepoName "lxtest"
|
|
86
144
|
Set-Location "y:\dev\homecontrol\Others\LifX\Apps\lxtest"
|
|
87
145
|
npm install
|
|
88
146
|
if ($LASTEXITCODE -ne 0) {
|
|
@@ -90,7 +148,7 @@ if ($LASTEXITCODE -ne 0) {
|
|
|
90
148
|
exit 1
|
|
91
149
|
}
|
|
92
150
|
|
|
93
|
-
Write-Host ">>> Releasing lxtest
|
|
151
|
+
Write-Host ">>> Releasing lxtest..." -ForegroundColor Yellow
|
|
94
152
|
npm run release
|
|
95
153
|
if ($LASTEXITCODE -ne 0) {
|
|
96
154
|
Write-Host "ERROR: lxtest release failed" -ForegroundColor Red
|
|
@@ -107,4 +165,4 @@ Write-Host " - @bobfrankston/colorlib"
|
|
|
107
165
|
Write-Host " - @bobfrankston/lxlan"
|
|
108
166
|
Write-Host " - @bobfrankston/lxlan-node"
|
|
109
167
|
Write-Host " - @bobfrankston/lifxer"
|
|
110
|
-
Write-Host " - lxtest
|
|
168
|
+
Write-Host " - lxtest"
|
package/release-all.bat
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
REM Release all LIFX packages in dependency order
|
|
3
|
-
REM Stops on first error for debugging
|
|
4
|
-
|
|
5
|
-
setlocal enabledelayedexpansion
|
|
6
|
-
|
|
7
|
-
REM Suppress npm and git color output to avoid escape sequences
|
|
8
|
-
set NO_COLOR=1
|
|
9
|
-
set FORCE_COLOR=0
|
|
10
|
-
set NPM_CONFIG_COLOR=false
|
|
11
|
-
|
|
12
|
-
echo.
|
|
13
|
-
echo === Releasing LIFX Packages ===
|
|
14
|
-
echo.
|
|
15
|
-
|
|
16
|
-
REM Base packages (no dependencies on each other)
|
|
17
|
-
echo ^>^>^> Releasing hlib...
|
|
18
|
-
cd /d "y:\dev\homecontrol\utils\hlib"
|
|
19
|
-
call npm run release
|
|
20
|
-
if errorlevel 1 (
|
|
21
|
-
echo ERROR: hlib release failed
|
|
22
|
-
exit /b 1
|
|
23
|
-
)
|
|
24
|
-
echo.
|
|
25
|
-
|
|
26
|
-
echo ^>^>^> Releasing rmfudp...
|
|
27
|
-
cd /d "y:\dev\homecontrol\utils\rmfudp"
|
|
28
|
-
call npm run release
|
|
29
|
-
if errorlevel 1 (
|
|
30
|
-
echo ERROR: rmfudp release failed
|
|
31
|
-
exit /b 1
|
|
32
|
-
)
|
|
33
|
-
echo.
|
|
34
|
-
|
|
35
|
-
echo ^>^>^> Releasing colorlib...
|
|
36
|
-
cd /d "y:\dev\homecontrol\utils\colorlib"
|
|
37
|
-
call npm run release
|
|
38
|
-
if errorlevel 1 (
|
|
39
|
-
echo ERROR: colorlib release failed
|
|
40
|
-
exit /b 1
|
|
41
|
-
)
|
|
42
|
-
echo.
|
|
43
|
-
|
|
44
|
-
echo ^>^>^> Releasing lxlan...
|
|
45
|
-
cd /d "y:\dev\homecontrol\Others\LifX\Apps\lxlan"
|
|
46
|
-
call npm run release
|
|
47
|
-
if errorlevel 1 (
|
|
48
|
-
echo ERROR: lxlan release failed
|
|
49
|
-
exit /b 1
|
|
50
|
-
)
|
|
51
|
-
echo.
|
|
52
|
-
|
|
53
|
-
REM Update dependencies after base packages
|
|
54
|
-
echo ^>^>^> Updating lxlan-node dependencies...
|
|
55
|
-
cd /d "y:\dev\homecontrol\Others\LifX\Apps\lxlan-node"
|
|
56
|
-
call npm install
|
|
57
|
-
if errorlevel 1 (
|
|
58
|
-
echo ERROR: lxlan-node npm install failed
|
|
59
|
-
exit /b 1
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
echo ^>^>^> Releasing lxlan-node...
|
|
63
|
-
call npm run release
|
|
64
|
-
if errorlevel 1 (
|
|
65
|
-
echo ERROR: lxlan-node release failed
|
|
66
|
-
exit /b 1
|
|
67
|
-
)
|
|
68
|
-
echo.
|
|
69
|
-
|
|
70
|
-
REM Update lifxer dependencies
|
|
71
|
-
echo ^>^>^> Updating lifxer dependencies...
|
|
72
|
-
cd /d "y:\dev\homecontrol\Others\LifX\Apps\lifxer"
|
|
73
|
-
call npm install
|
|
74
|
-
if errorlevel 1 (
|
|
75
|
-
echo ERROR: lifxer npm install failed
|
|
76
|
-
exit /b 1
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
echo ^>^>^> Releasing lifxer...
|
|
80
|
-
call npm run release
|
|
81
|
-
if errorlevel 1 (
|
|
82
|
-
echo ERROR: lifxer release failed
|
|
83
|
-
exit /b 1
|
|
84
|
-
)
|
|
85
|
-
echo.
|
|
86
|
-
|
|
87
|
-
REM lxtest (local only, no publish)
|
|
88
|
-
echo ^>^>^> Updating lxtest dependencies...
|
|
89
|
-
cd /d "y:\dev\homecontrol\Others\LifX\Apps\lxtest"
|
|
90
|
-
call npm install
|
|
91
|
-
if errorlevel 1 (
|
|
92
|
-
echo ERROR: lxtest npm install failed
|
|
93
|
-
exit /b 1
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
echo ^>^>^> Releasing lxtest (local only)...
|
|
97
|
-
call npm run release
|
|
98
|
-
if errorlevel 1 (
|
|
99
|
-
echo ERROR: lxtest release failed
|
|
100
|
-
exit /b 1
|
|
101
|
-
)
|
|
102
|
-
echo.
|
|
103
|
-
|
|
104
|
-
echo === All releases completed successfully! ===
|
|
105
|
-
echo.
|
|
106
|
-
echo Released packages:
|
|
107
|
-
echo - @bobfrankston/hlib
|
|
108
|
-
echo - @bobfrankston/rmfudp
|
|
109
|
-
echo - @bobfrankston/colorlib
|
|
110
|
-
echo - @bobfrankston/lxlan
|
|
111
|
-
echo - @bobfrankston/lxlan-node
|
|
112
|
-
echo - @bobfrankston/lifxer
|
|
113
|
-
echo - lxtest (local)
|