@weezy20/zv 0.3.1 → 0.4.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/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ ## v0.3.1 → v0.4.0
4
+
5
+ ## ✨ Features
6
+
7
+ - **`zv init`**: Added `build.zig.zon` generation via `-p/--package/--zon` flag (#17)
8
+ - **`zv init`**: Generate `.zigversion` file to specify minimum Zig version for builds
9
+ - **Self-update**: Refactored using `self-replace` dependency with SHA256 verification for downloaded github assets (#21). This also removes a ton of dependencies.
10
+ - **Self-update**: Added `upgrade` as alias for `update` command
11
+ - **Self-update**: Added `--rc` flag to include pre-release versions when checking for updates
12
+
13
+ ## Bug Fixes
14
+
15
+ - Fixed phantom active Zig display when no version was set (zv)
16
+ - Fixed toolchain manager fallback for mismatches between version scan and `active.json`
17
+ - Improved auto-switching logic when cleaning/removing installations
18
+ - Fixed ZIP extraction path issues in update mechanism
19
+
20
+ ## Others
21
+
22
+ - Deduplicated shim generation logic, Added quiet flag to supress output during automatic shim regeneration
23
+ - Target triple detection now at compile time
24
+ - Better async handling (replaced blocking calls with `await`)
25
+ - Updated documentation and Homebrew tap configuration
26
+
27
+ ---
package/README.md CHANGED
@@ -34,15 +34,29 @@ Windows (PowerShell):
34
34
  ```powershell
35
35
  irm https://github.com/weezy20/zv/releases/latest/download/zv-installer.ps1 | iex
36
36
  ```
37
+ If you encounter an execution policy error, you can temporarily allow script execution by running:
38
+ ```powershell
39
+ powershell -ExecutionPolicy Bypass -Command "irm https://github.com/weezy20/zv/releases/latest/download/zv-installer.ps1 | iex"
40
+ ```
41
+
42
+ >The following methods use different package managers hence, after running `zv setup` we uninstall the package manager version of `zv` to avoid confusion. Since `zv` can self update for popular OS/Arch combinations, you don't need to rely on package managers for updates.
37
43
 
38
44
  **HomeBrew:**
39
45
  ```sh
40
46
  brew install weezy20/tap/zv
47
+ # Run zv setup to self-install
48
+ zv setup
49
+ # Remove brew installation
50
+ brew uninstall zv
41
51
  ```
42
52
 
43
53
  **NPM:**
44
54
  ```sh
45
55
  npm install -g @weezy20/zv
56
+ # Run zv setup to self-install
57
+ zv setup
58
+ # Remove npm installation
59
+ npm uninstall -g @weezy20/zv
46
60
  ```
47
61
 
48
62
  <details>
@@ -158,7 +172,12 @@ You can customize this by setting the `ZV_DIR` environment variable.
158
172
  zv init [project_name] # Create a new Zig project with a name
159
173
  zv init # Create a new Zig project in the current working directory
160
174
  zv init --zig | -z # Create a new Zig project using the standard template provided by `zig init`
175
+ # Create a zig project with build.zig.zon:
176
+ zv init -p | --zon | --package <?name> # Create a zig project in current directory with build.zig.zon or with name if provided
177
+ # Note: this requires an active zig version >= 0.12.0 where build.zig.zon support was introduced
178
+
161
179
  ```
180
+ >Note: `zv init` will use the `build.zig` that's present in [templates/build.zig](templates/lean_build.zig) which is checked to work against minimum zig version specified in [templates/.zigversion](templates/.zigversion). If you want to use a different zig version, set it as active zig and use `zv init -z` or `zig init` directly.
162
181
 
163
182
  ## Use `zv` as your Zig compiler toolchain manager:
164
183
 
@@ -209,6 +228,7 @@ I hope you enjoy using it! ♥
209
228
  | **`ZV_DIR`** | Defines the home directory for `zv`. | Default `$HOME/.zv` for linux/macos or unix. For windows it usually will be `%USERPROFILE%/.zv` |
210
229
  | **`ZV_INDEX_TTL_DAYS`** | Number of days between automatic [index](https://ziglang.org/download/index.json) syncs. | **21 days** — Using `master` or `latest` in inline mode use a shorter cache duration of just 1 day unlike `use` which will always fetch `master` & `latest` from network, so practically, you never have to worry about setting this variable yourself. |
211
230
  | **`ZV_MIRRORS_TTL_DAYS`** | Number of days before refreshing the mirrors list. Broken mirrors degrade automatically. Use `zv sync` to force refresh. | **21 days** — mirrors and index can be resynced immediately with `zv sync`. `master` relies on latest builds & so does `latest` and some community mirrors may not have it available; `zv` will retry other mirrors in that case. |
231
+ | **`ZV_MAX_RETRIES`** | Maximum number of retry attempts for downloads when a download fails. | **3 retries** — If a download fails, `zv` will retry up to this many times before giving up. |
212
232
  | **`NO_COLOR`** | If set, disables color output in all zv commands. | No color output; useful for non-TTY environments or scripts. |
213
233
  |**`ZV_FETCH_TIMEOUT_SECS`** | Request timeout to use for network operations requiring fetching index/mirrors list from `ziglang.org`. | Default 15 seconds for most operations.
214
234
 
@@ -23,7 +23,7 @@
23
23
  "hasInstallScript": true,
24
24
  "license": "MIT",
25
25
  "name": "@weezy20/zv",
26
- "version": "0.3.1"
26
+ "version": "0.4.0"
27
27
  },
28
28
  "node_modules/@isaacs/balanced-match": {
29
29
  "engines": {
@@ -896,5 +896,5 @@
896
896
  }
897
897
  },
898
898
  "requires": true,
899
- "version": "0.3.1"
899
+ "version": "0.4.0"
900
900
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "artifactDownloadUrl": "https://github.com/weezy20/zv/releases/download/v0.3.1",
2
+ "artifactDownloadUrl": "https://github.com/weezy20/zv/releases/download/v0.4.0",
3
3
  "author": "Abhishek Shah <abhishekshah3@gmail.com>",
4
4
  "bin": {
5
5
  "zv": "run-zv.js"
@@ -105,7 +105,7 @@
105
105
  "zipExt": ".tar.gz"
106
106
  }
107
107
  },
108
- "version": "0.3.1",
108
+ "version": "0.4.0",
109
109
  "volta": {
110
110
  "node": "18.14.1",
111
111
  "npm": "9.5.0"