@darkrei08/setup-ai 3.0.0 → 3.0.1

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/README.md CHANGED
@@ -30,6 +30,11 @@ macOS/Linux (via `bash`). With no selection flag on an interactive terminal it
30
30
  opens an arrow-key **multi-select menu** (↑/↓ move · Space toggle · `a` all ·
31
31
  Enter confirm); on a non-interactive shell it installs the core set.
32
32
 
33
+ > **Windows / PowerShell**: paste each command on a **single line** — the bash
34
+ > `\` line-continuation is not valid in PowerShell. If a runtime (node, git) was
35
+ > just installed this run, open a **new terminal** before re-running so the
36
+ > updated PATH is picked up.
37
+
33
38
  ### npm vs npx
34
39
 
35
40
  | | `npm` | `npx` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darkrei08/setup-ai",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Cross-OS installer for an AI coding toolchain (pi, codex, antigravity, opencode, herdr, gentle-ai, engram, Engineering Excellence) with an interactive module menu.",
5
5
  "type": "module",
6
6
  "bin": {
package/setup-ai.ps1 CHANGED
@@ -33,7 +33,7 @@ param(
33
33
  $ErrorActionPreference = 'Stop'
34
34
  Set-StrictMode -Version Latest
35
35
 
36
- $ScriptVersion = "3.0.0"
36
+ $ScriptVersion = "3.0.1"
37
37
  $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
38
38
  $LogDir = Join-Path $ScriptDir "logs"
39
39
  New-Item -ItemType Directory -Force -Path $LogDir | Out-Null
@@ -78,6 +78,14 @@ function Write-Log {
78
78
 
79
79
  function Test-Cmd { param([string]$Name) [bool](Get-Command $Name -ErrorAction SilentlyContinue) }
80
80
 
81
+ # winget updates the registry PATH, not the live process. Re-read it so tools
82
+ # installed this run (node, git, ...) resolve without opening a new terminal.
83
+ function Update-SessionPath {
84
+ $machine = [Environment]::GetEnvironmentVariable('Path','Machine')
85
+ $user = [Environment]::GetEnvironmentVariable('Path','User')
86
+ $env:Path = (@($machine, $user) | Where-Object { $_ }) -join ';'
87
+ }
88
+
81
89
  # Run a step; $Optional means failures are logged as WARN and swallowed.
82
90
  function Invoke-Step {
83
91
  param([string]$Phase, [scriptblock]$Action, [switch]$Optional)
@@ -156,12 +164,25 @@ function Mod-Base {
156
164
  Install-Winget -Id "GitHub.cli" -Phase "base"
157
165
  Install-Winget -Id "Python.Python.3.12" -Phase "base"
158
166
  Install-Winget -Id "Neovim.Neovim" -Phase "base"
167
+ Update-SessionPath
159
168
  }
160
169
 
161
170
  function Mod-Node {
162
171
  Write-Log INFO "node" "start" "Node.js"
163
- if (-not (Test-Cmd node)) { Install-Winget -Id "OpenJS.NodeJS.LTS" -Phase "node" }
164
- if (Test-Cmd npm) { Invoke-Step -Phase "node" -Optional -Action { npm install -g npm@latest } }
172
+ if (-not (Test-Cmd node)) {
173
+ Install-Winget -Id "OpenJS.NodeJS.LTS" -Phase "node"
174
+ Update-SessionPath
175
+ # winget's PATH refresh can still lag; add the default install dir directly.
176
+ $nodeDir = Join-Path $env:ProgramFiles "nodejs"
177
+ if ((-not (Test-Cmd node)) -and (Test-Path (Join-Path $nodeDir "node.exe"))) {
178
+ $env:Path = "$nodeDir;$env:Path"
179
+ }
180
+ }
181
+ if (Test-Cmd npm) {
182
+ Invoke-Step -Phase "node" -Optional -Action { npm install -g npm@latest }
183
+ } else {
184
+ Write-Log WARN "node" "unresolved" "node/npm not on PATH after install — open a NEW terminal and re-run (node-dependent modules will be skipped)"
185
+ }
165
186
  }
166
187
 
167
188
  function Mod-Bun {
package/setup-ai.sh CHANGED
@@ -26,7 +26,7 @@
26
26
  set -Eeuo pipefail
27
27
  IFS=$'\n\t'
28
28
 
29
- SCRIPT_VERSION="3.0.0"
29
+ SCRIPT_VERSION="3.0.1"
30
30
 
31
31
  SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
32
32
  LOG_DIR="${SCRIPT_DIR}/logs"
@@ -441,6 +441,11 @@ mod_node() {
441
441
  run_cmd "node" bash "${installer}"
442
442
  fi
443
443
 
444
+ # nvm refuses to operate when npm_config_prefix is set (e.g. to /usr/local),
445
+ # aborting with "nvm is not compatible with the npm_config_prefix ...".
446
+ # It is only needed by nvm's own shims, so drop it for this process.
447
+ unset npm_config_prefix NPM_CONFIG_PREFIX 2>/dev/null || true
448
+
444
449
  # shellcheck disable=SC1090
445
450
  source "${NVM_DIR}/nvm.sh"
446
451