sixfold 0.0.0-stage → 0.1.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.
package/install.ps1 ADDED
@@ -0,0 +1,90 @@
1
+ # Sixfold one-line installer for Windows (PowerShell 5.1+ or PowerShell 7).
2
+ # irm https://raw.githubusercontent.com/globalkonvict/sixfold/main/packages/installer/install.ps1 | iex
3
+ # & ([scriptblock]::Create((irm <same url>))) --theme hardwire --dry-run (arguments go to `npx sixfold`)
4
+ # With Node.js 20+ it runs the full installer (`npx sixfold`). Without Node it installs the two extensions with the
5
+ # editor's own CLI, verified against the release's SHA256SUMS, and the editor's first-run notification does the rest.
6
+ # It never asks for administrator rights.
7
+ $ErrorActionPreference = 'Stop'
8
+ # Run as a file, report through the exit code. Piped into iex, `exit` would close the user's own window: return instead.
9
+ $AsFile = [bool]$PSCommandPath
10
+ $Version = '0.1.0'
11
+ $Repo = 'globalkonvict/sixfold'
12
+ $Package = if ($env:SIXFOLD_PACKAGE) { $env:SIXFOLD_PACKAGE } else { "sixfold@$Version" } # test hook: a local package folder
13
+
14
+ function Get-NodeMajor {
15
+ try { [int](& node -p "process.versions.node.split('.')[0]") } catch { 0 }
16
+ }
17
+
18
+ if (-not $env:SIXFOLD_FORCE_FALLBACK -and (Get-Command node -ErrorAction SilentlyContinue) -and (Get-Command npx -ErrorAction SilentlyContinue) -and ((Get-NodeMajor) -ge 20)) {
19
+ # npm's npx.ps1 rebuilds its arguments from the caller's source text, which loses splatted @args; npx.cmd passes them through.
20
+ $npx = if (Get-Command npx.cmd -ErrorAction SilentlyContinue) { 'npx.cmd' } else { 'npx' }
21
+ & $npx --yes $Package @args
22
+ if ($AsFile) { exit $LASTEXITCODE }; return
23
+ }
24
+
25
+ # --- Fallback: no Node.js 20+ -----------------------------------------------------------------------------------
26
+ $Dry = $args -contains '--dry-run'
27
+ Write-Host 'Node.js 20+ was not found, so this installs the Sixfold extensions only.'
28
+ Write-Host 'Open the editor afterwards: a notification offers "Apply full makeover", "Colors only" or "What will change?".'
29
+
30
+ $clis = New-Object System.Collections.Generic.List[string]
31
+ foreach ($c in 'code', 'code-insiders', 'cursor', 'windsurf', 'codium', 'antigravity-ide') {
32
+ $cmd = Get-Command "$c.cmd" -ErrorAction SilentlyContinue
33
+ if ($cmd -and -not $clis.Contains($cmd.Source)) { $clis.Add($cmd.Source) }
34
+ }
35
+ $known = @{ 'Microsoft VS Code' = 'code'; 'Microsoft VS Code Insiders' = 'code-insiders'; 'cursor' = 'cursor'; 'Windsurf' = 'windsurf'; 'VSCodium' = 'codium'; 'Antigravity IDE' = 'antigravity-ide' }
36
+ foreach ($base in @((Join-Path $env:LOCALAPPDATA 'Programs'), $env:ProgramFiles)) {
37
+ if (-not $base) { continue }
38
+ foreach ($dir in $known.Keys) {
39
+ $p = Join-Path $base "$dir\bin\$($known[$dir]).cmd"
40
+ if ((Test-Path $p) -and -not $clis.Contains($p)) { $clis.Add($p) }
41
+ }
42
+ }
43
+ if ($clis.Count -eq 0) {
44
+ Write-Host 'No VS Code-based editor CLI found (code, cursor, windsurf, codium, antigravity-ide). Install one and try again.'
45
+ if ($AsFile) { exit 1 }; return
46
+ }
47
+
48
+ $base = if ($env:SIXFOLD_RELEASE_BASE) { $env:SIXFOLD_RELEASE_BASE } else { "https://github.com/$Repo/releases/download/v$Version" } # test hook: a locally served release
49
+ $files = @("sixfold-themes-$Version.vsix", "sixfold-$Version.vsix")
50
+ if ($Dry) {
51
+ Write-Host "Dry run. Would download $($files -join ' and ') from $base, check them against SHA256SUMS, and install them with:"
52
+ foreach ($c in $clis) { Write-Host " `"$c`" --install-extension <both files> --force" }
53
+ if ($AsFile) { exit 0 }; return
54
+ }
55
+
56
+ $tmp = Join-Path ([System.IO.Path]::GetTempPath()) ("sixfold-" + [guid]::NewGuid())
57
+ New-Item -ItemType Directory -Path $tmp | Out-Null
58
+ try {
59
+ [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
60
+ Invoke-WebRequest -UseBasicParsing -Uri "$base/SHA256SUMS" -OutFile (Join-Path $tmp 'SHA256SUMS')
61
+ $sums = @{}
62
+ foreach ($line in Get-Content (Join-Path $tmp 'SHA256SUMS')) {
63
+ $parts = $line.Trim() -split '\s+'
64
+ if ($parts.Count -ge 2) { $sums[$parts[1].TrimStart('*')] = $parts[0].ToLower() }
65
+ }
66
+ foreach ($f in $files) {
67
+ $out = Join-Path $tmp $f
68
+ Invoke-WebRequest -UseBasicParsing -Uri "$base/$f" -OutFile $out
69
+ $got = (Get-FileHash -Algorithm SHA256 $out).Hash.ToLower()
70
+ if ($sums[$f] -ne $got) { Write-Host "Checksum mismatch for $f. Nothing was installed."; if ($AsFile) { exit 1 }; return }
71
+ }
72
+ foreach ($c in $clis) {
73
+ Write-Host "Installing into $c"
74
+ # Antigravity IDE's CLI crashes on about 2 runs in 5 ("... is NOT registered"); retry that crash only.
75
+ # PowerShell 5.1 turns anything a program writes to stderr into an error, and 'Stop' would end the script on the
76
+ # editor CLI's harmless warnings (a Node deprecation notice). Judge the CLI by its exit code instead.
77
+ $ErrorActionPreference = 'Continue'
78
+ for ($i = 0; $i -lt 5; $i++) {
79
+ $out = & $c --install-extension (Join-Path $tmp $files[0]) --install-extension (Join-Path $tmp $files[1]) --force 2>&1 | ForEach-Object { "$_" } | Out-String
80
+ $code = $LASTEXITCODE
81
+ if ($code -eq 0 -or $out -notmatch 'is NOT registered') { break }
82
+ }
83
+ $ErrorActionPreference = 'Stop'
84
+ Write-Host $out
85
+ if ($code -ne 0) { throw "$c failed with exit code $code" }
86
+ }
87
+ Write-Host 'Done. Open your editor and choose "Apply full makeover" or "Colors only" in the Sixfold notification.'
88
+ } finally {
89
+ Remove-Item -Recurse -Force $tmp -ErrorAction SilentlyContinue
90
+ }
package/install.sh ADDED
@@ -0,0 +1,81 @@
1
+ #!/bin/sh
2
+ # Sixfold one-line installer for macOS and Linux.
3
+ # curl -fsSL https://raw.githubusercontent.com/globalkonvict/sixfold/main/packages/installer/install.sh | sh
4
+ # ... | sh -s -- --theme hardwire --dry-run (arguments go to `npx sixfold`; see --help)
5
+ # With Node.js 20+ it runs the full installer (`npx sixfold`). Without Node it installs the two extensions with the
6
+ # editor's own CLI, verified against the release's SHA256SUMS, and the editor's first-run notification does the rest.
7
+ # It never uses sudo.
8
+ set -eu
9
+
10
+ VERSION="0.1.0"
11
+ REPO="globalkonvict/sixfold"
12
+ PACKAGE="${SIXFOLD_PACKAGE:-sixfold@$VERSION}" # test hook: a local package folder
13
+
14
+ say() { printf '%s\n' "$*"; }
15
+
16
+ node_major() { node -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo 0; }
17
+
18
+ if [ -z "${SIXFOLD_FORCE_FALLBACK:-}" ] && command -v node >/dev/null 2>&1 && command -v npx >/dev/null 2>&1 && [ "$(node_major)" -ge 20 ]; then
19
+ # Piped into sh, stdin is the script itself: read answers from the terminal when there is one.
20
+ if [ -r /dev/tty ] && [ -t 1 ]; then exec npx --yes "$PACKAGE" "$@" < /dev/tty; fi
21
+ exec npx --yes "$PACKAGE" "$@"
22
+ fi
23
+
24
+ # --- Fallback: no Node.js 20+ -----------------------------------------------------------------------------------
25
+ DRY=""
26
+ for a in "$@"; do [ "$a" = "--dry-run" ] && DRY=1; done
27
+ say "Node.js 20+ was not found, so this installs the Sixfold extensions only."
28
+ say "Open the editor afterwards: a notification offers \"Apply full makeover\", \"Colors only\" or \"What will change?\"."
29
+
30
+ # One CLI path per line: macOS app paths contain spaces.
31
+ NL='
32
+ '
33
+ CLIS=""
34
+ add() { case "$NL$CLIS$NL" in *"$NL$1$NL"*) ;; *) CLIS="${CLIS:+$CLIS$NL}$1" ;; esac; }
35
+ for c in code code-insiders cursor windsurf codium antigravity-ide; do
36
+ if command -v "$c" >/dev/null 2>&1; then add "$(command -v "$c")"; fi
37
+ done
38
+ if [ "$(uname)" = "Darwin" ]; then
39
+ for app in "Visual Studio Code:code" "Visual Studio Code - Insiders:code-insiders" "Cursor:cursor" "Windsurf:windsurf" "VSCodium:codium" "Antigravity IDE:antigravity-ide"; do
40
+ for base in /Applications "$HOME/Applications"; do
41
+ p="$base/${app%%:*}.app/Contents/Resources/app/bin/${app##*:}"
42
+ if [ -x "$p" ]; then add "$p"; fi
43
+ done
44
+ done
45
+ fi
46
+ if [ -z "$CLIS" ]; then
47
+ say "No VS Code-based editor CLI found (code, cursor, windsurf, codium, antigravity-ide). Install one and try again."
48
+ exit 1
49
+ fi
50
+
51
+ BASE="${SIXFOLD_RELEASE_BASE:-https://github.com/$REPO/releases/download/v$VERSION}" # test hook: a locally served release
52
+ FILES="sixfold-themes-$VERSION.vsix sixfold-$VERSION.vsix"
53
+ if [ -n "$DRY" ]; then
54
+ say "Dry run. Would download $FILES from $BASE, check them against SHA256SUMS, and install them with:"
55
+ printf '%s\n' "$CLIS" | while IFS= read -r c; do say " \"$c\" --install-extension <both files> --force"; done
56
+ exit 0
57
+ fi
58
+
59
+ TMP="$(mktemp -d)"
60
+ trap 'rm -rf "$TMP"' EXIT
61
+ cd "$TMP"
62
+ curl -fsSL -o SHA256SUMS "$BASE/SHA256SUMS"
63
+ for f in $FILES; do curl -fsSL -o "$f" "$BASE/$f"; done
64
+ if command -v sha256sum >/dev/null 2>&1; then SUM="sha256sum"; else SUM="shasum -a 256"; fi
65
+ for f in $FILES; do
66
+ want="$(grep " \*\{0,1\}$f\$" SHA256SUMS | cut -d' ' -f1)"
67
+ got="$($SUM "$f" | cut -d' ' -f1)"
68
+ if [ -z "$want" ] || [ "$want" != "$got" ]; then say "Checksum mismatch for $f. Nothing was installed."; exit 1; fi
69
+ done
70
+ printf '%s\n' "$CLIS" | while IFS= read -r c; do
71
+ say "Installing into $c"
72
+ # Antigravity IDE's CLI crashes on about 2 runs in 5 ("... is NOT registered"); retry that crash only.
73
+ n=0
74
+ until out="$("$c" --install-extension "sixfold-themes-$VERSION.vsix" --install-extension "sixfold-$VERSION.vsix" --force 2>&1 </dev/null)"; do # stdin is the editor list
75
+ n=$((n + 1))
76
+ case "$out" in *"is NOT registered"*) [ "$n" -lt 5 ] && continue ;; esac
77
+ printf '%s\n' "$out"; say "Installing into $c failed. Nothing else was changed."; exit 1
78
+ done
79
+ printf '%s\n' "$out"
80
+ done
81
+ say "Done. Open your editor and choose \"Apply full makeover\" or \"Colors only\" in the Sixfold notification."
package/package.json CHANGED
@@ -1,6 +1,36 @@
1
1
  {
2
2
  "name": "sixfold",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Install, remove or roll back the Sixfold makeover (six full-workbench themes) for VS Code, Cursor, Windsurf, VSCodium and Antigravity IDE.",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "sixfold": "dist/cli.cjs"
8
+ },
9
+ "files": [
10
+ "dist/cli.cjs",
11
+ "install.sh",
12
+ "install.ps1",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/globalkonvict/sixfold.git",
22
+ "directory": "packages/installer"
23
+ },
24
+ "homepage": "https://github.com/globalkonvict/sixfold#readme",
25
+ "bugs": {
26
+ "url": "https://github.com/globalkonvict/sixfold/issues"
27
+ },
28
+ "keywords": [
29
+ "vscode",
30
+ "theme",
31
+ "cursor",
32
+ "vscodium",
33
+ "windsurf",
34
+ "installer"
35
+ ]
36
+ }