@technicalshree/auto-fix 1.2.0 → 1.2.2

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.
Files changed (2) hide show
  1. package/README.md +78 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -11,6 +11,10 @@
11
11
  - Supports gated destructive cleanup (`--deep`, `--approve`)
12
12
  - Writes run reports and snapshot metadata for rollback
13
13
  - Supports best-effort `undo` for snapshotted changes
14
+ - Syncs `.env` files from `.env.example` templates (v1.2)
15
+ - Detects Node/Python runtime version drift (v1.2)
16
+ - Auto-configures VS Code Python interpreter path (v1.2)
17
+ - Provides actionable guidance for EPERM/EBUSY file lock errors (v1.2)
14
18
 
15
19
  ## Requirements
16
20
 
@@ -162,6 +166,56 @@ auto-fix clear-yarn-cache
162
166
  auto-fix clear-pnpm-cache
163
167
  ```
164
168
 
169
+ ## v1.2 Features
170
+
171
+ ### Environment Variable Synchronization
172
+
173
+ `auto-fix` detects `.env.example` files and helps keep your local `.env` in sync:
174
+
175
+ - **Missing `.env`**: If `.env.example` exists but `.env` does not, auto-fix will copy it automatically.
176
+ - **Missing keys**: If both files exist, auto-fix compares the keys and appends any missing keys from `.env.example` to your `.env` with empty values.
177
+ - Changes to `.env` are snapshotted for undo coverage.
178
+
179
+ ```bash
180
+ # See env sync in action
181
+ auto-fix plan
182
+ # Output: ● Copy .env.example to .env
183
+ # Output: ● Append 2 missing key(s) to .env
184
+ ```
185
+
186
+ ### Runtime Engine Version Checks
187
+
188
+ `auto-fix` validates that your local Node.js and Python versions match what the project expects:
189
+
190
+ - **Node**: Reads `.nvmrc` or `.node-version` and compares the major version against `process.version`. Emits a warning with suggested action (`nvm use`).
191
+ - **Python**: Reads `.python-version` and flags a version drift warning.
192
+ - These checks run **before** dependency installations to catch mismatches early.
193
+ - Engine checks fire based on version file existence alone — no `package.json` or `pyproject.toml` required.
194
+
195
+ ```bash
196
+ auto-fix plan
197
+ # Output: ● Node version drift detected: expected ~18, running v22.x — Run nvm use
198
+ # Output: ● Python version drift: project expects 3.11
199
+ ```
200
+
201
+ ### VS Code Python Integration
202
+
203
+ When a Python virtual environment (`.venv`) exists or is being created, `auto-fix` automatically configures VS Code to use it:
204
+
205
+ - Sets `python.defaultInterpreterPath` in `.vscode/settings.json`
206
+ - Prevents false-positive Pylance/Pyright linting errors for new developers
207
+ - The change is snapshotted for undo coverage
208
+
209
+ ### EPERM/EBUSY Error Guidance
210
+
211
+ When `node_modules` cleanup or dependency installation fails due to file locks (common on Windows and macOS), `auto-fix` now provides specific, actionable error messages:
212
+
213
+ ```
214
+ ✖ Permission/lock error (EPERM/EBUSY). Close your IDE, dev servers, or file watchers and retry.
215
+ ```
216
+
217
+ This replaces the previous generic "One or more commands failed" message.
218
+
165
219
  ## Commands
166
220
 
167
221
  `auto-fix [command] [flags]`
@@ -381,9 +435,14 @@ npm run build
381
435
  - `src/config/`: defaults and config loading
382
436
  - `src/report/`: summary and report writing
383
437
  - `src/subsystems/`: subsystem-specific checks/fixes
438
+ - `environment.ts`: `.env` sync logic (v1.2)
439
+ - `engines.ts`: runtime version checks (v1.2)
384
440
  - `src/ui/`: terminal renderer and progress hooks
385
441
  - `dist/`: compiled JavaScript output
386
442
  - `docs/`: product requirement docs and notes
443
+ - `test/`: test suites
444
+ - `smoke.test.mjs`: CLI smoke tests
445
+ - `v1.2.test.mjs`: v1.2 feature unit tests
387
446
 
388
447
  ## Troubleshooting
389
448
 
@@ -403,6 +462,25 @@ Non-interactive environments behave conservatively:
403
462
 
404
463
  - In polyglot projects (Node + Python + Docker), non-interactive mode without `--approve` may limit execution to a safe subset
405
464
 
465
+ ## Changelog
466
+
467
+ ### v1.2.0
468
+
469
+ - **Environment sync**: Auto-copy `.env.example` → `.env`; detect and append missing keys
470
+ - **Engine version checks**: Validate Node (`.nvmrc`) and Python (`.python-version`) versions before dependency install
471
+ - **VS Code integration**: Auto-configure `python.defaultInterpreterPath` when `.venv` exists
472
+ - **EPERM handling**: Actionable error messages for file lock failures in node steps
473
+ - **Snapshot improvements**: Non-destructive steps with declared snapshot paths are now backed up
474
+ - **Undo fix**: Nested file paths (e.g., `.vscode/settings.json`) are now restored correctly
475
+ - **Test coverage**: Added 8 unit tests for v1.2 features
476
+
477
+ ### v1.1.x
478
+
479
+ - Initial release with Node, Python, Docker detection and safe fix execution
480
+ - Polyglot project support with interactive confirmation
481
+ - Run reports, snapshots, and best-effort undo
482
+ - CLI help, version banner, and configurable `.autofix.yml`
483
+
406
484
  ## License
407
485
 
408
486
  ISC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@technicalshree/auto-fix",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Detect, diagnose, and safely fix common local dev environment issues",
5
5
  "main": "dist/cli.js",
6
6
  "repository": {