package-version-info 0.2.4 → 0.3.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/README.md CHANGED
@@ -41,7 +41,7 @@ npm install package-version-info --save-dev
41
41
  ```
42
42
 
43
43
  ```bash
44
- yarn add package-version-info --dev
44
+ bun add --dev package-version-info
45
45
  ```
46
46
 
47
47
  The npm package includes native executables for macOS arm64/x64, Linux arm64/x64, and Windows
@@ -55,7 +55,7 @@ npx package-version-info --output src/version-info.ts
55
55
  ```
56
56
 
57
57
  ```text
58
- Generated src/version-info.ts (v1.0.0, 2.00ms)
58
+ Generated src/version-info.ts v1.0.0 2.00 ms
59
59
  ```
60
60
 
61
61
  ### 3. Import it
@@ -107,7 +107,8 @@ npx package-version-info
107
107
  | --- | --- | --- | --- |
108
108
  | `--help` | `-h` | — | Display usage information. |
109
109
  | `--version` | `-v` | — | Display the installed package version. |
110
- | `--verbose` | — | Disabled | Display detailed generation progress. |
110
+ | `--verbose` | — | Disabled | Display a detailed generation summary. |
111
+ | `--dry-run` | — | Disabled | Print TypeScript without creating a file. |
111
112
  | `--input <path>` | `-i` | `package.json` | Input package file. |
112
113
  | `--output <path>` | `-o` | `version-info.ts` | Generated TypeScript file. |
113
114
  | `--git <path>` | `-g` | `.git` | Git directory or pointer file used for branch and commit metadata. |
@@ -124,6 +125,12 @@ npx package-version-info
124
125
  # Show detailed progress
125
126
  npx package-version-info --verbose
126
127
 
128
+ # Preview generated TypeScript without creating a file
129
+ npx package-version-info --dry-run
130
+
131
+ # Pipe the preview to another command
132
+ npx package-version-info --dry-run | less
133
+
127
134
  # Use custom paths
128
135
  npx package-version-info \
129
136
  --input package.json \
@@ -142,7 +149,7 @@ npx package-version-info \
142
149
  Compact mode is designed for normal builds:
143
150
 
144
151
  ```text
145
- Generated src/version-info.ts (v1.0.0, 2.00ms)
152
+ Generated src/version-info.ts v1.0.0 2.00 ms
146
153
  ```
147
154
 
148
155
  Use verbose mode when diagnosing package, author, timestamp, Git, or output-path behavior:
@@ -151,6 +158,27 @@ Use verbose mode when diagnosing package, author, timestamp, Git, or output-path
151
158
  npx package-version-info --verbose
152
159
  ```
153
160
 
161
+ ```text
162
+ › Package package.json • v1.0.0
163
+ › Author Dominik Hladík • dominik.hladik@seznam.cz • https://github.com/Celtian
164
+ › Timestamp 2026-07-16T18:53:01.908Z
165
+ › Git main • 8be6ca60256cc90e0a41d40b9ee222165f239444
166
+ ✓ Generated version-info.ts • v1.0.0 • 2.00 ms
167
+ ```
168
+
169
+ ### Dry-run preview
170
+
171
+ Use `--dry-run` to print the generated TypeScript to stdout without creating the configured output
172
+ file or its parent directories:
173
+
174
+ ```bash
175
+ npx package-version-info --dry-run
176
+ ```
177
+
178
+ The stdout stream contains only TypeScript, with no colors or status text, so it can be redirected
179
+ or piped directly. Combining `--verbose` with `--dry-run` keeps the TypeScript on stdout and writes
180
+ the colored diagnostic summary to stderr, ending with `✓ Previewed`.
181
+
154
182
  ## 🛠️ Build-tool integration
155
183
 
156
184
  Generate version information automatically before your application build:
@@ -174,7 +202,7 @@ Requirements:
174
202
 
175
203
  - [Zig 0.16.0](https://ziglang.org/download/)
176
204
  - Node.js 24
177
- - Yarn 1.22.22
205
+ - Bun 1.3.14
178
206
 
179
207
  ```bash
180
208
  # Build the executable
@@ -184,7 +212,7 @@ zig build
184
212
  zig build run
185
213
 
186
214
  # Run all formatting, build, and test checks
187
- yarn validate
215
+ bun run validate
188
216
  ```
189
217
 
190
218
  <details>
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "package-version-info",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "author": {
5
5
  "name": "Dominik Hladík",
6
6
  "email": "dominik.hladik@seznam.cz",