@programinglive/commiter 1.0.12 β†’ 1.1.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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.1.1](https://github.com/programinglive/commiter/compare/v1.1.0...v1.1.1) (2025-11-05)
6
+
7
+
8
+ ### πŸ› Bug Fixes
9
+
10
+ * remove fs.F_OK deprecation warning ([1b0652b](https://github.com/programinglive/commiter/commit/1b0652b88d1b095e1045994948f75ce8194f9d3a))
11
+
12
+ ## [1.1.0](https://github.com/programinglive/commiter/compare/v1.0.12...v1.1.0) (2025-10-29)
13
+
14
+
15
+ ### πŸ“ Documentation
16
+
17
+ * clarify release automation flow ([1cf7aa2](https://github.com/programinglive/commiter/commit/1cf7aa2432f371eac69d6931c8a497991686bfc6))
18
+
5
19
  ### [1.0.12](https://github.com/programinglive/commiter/compare/v1.0.11...v1.0.12) (2025-10-29)
6
20
 
7
21
 
package/PRD.md ADDED
@@ -0,0 +1,86 @@
1
+ # Commiter Product Requirements Document (PRD)
2
+
3
+ ## 1. Overview
4
+ Commiter is a CLI utility that bootstraps and automates conventional release workflows for JavaScript/TypeScript projects. It enforces commit conventions, orchestrates semantic version bumps, keeps release tooling configured, and surfaces feedback during release execution so teams can ship confidently.
5
+
6
+ ## 2. Problem Statement
7
+ Growing teams often struggle to keep release processes consistent: commit messages drift from convention, changelogs become stale, and release scripts accumulate manual steps. Commiter removes this friction by installing opinionated tooling, providing curated scripts, and running guard rails (tests, linters) before invoking `standard-version` to publish a release.
8
+
9
+ ## 3. Goals & Success Metrics
10
+ - **Consistent releases**: Every release run through Commiter formats commits, updates changelogs, tags, and version bumps without manual editing.
11
+ - **Low ceremony onboarding**: A single `npx commiter` command prepares repositories (Husky, commitlint, release scripts).
12
+ - **Signal-rich automation**: Release logs clearly show which steps ran, including any warnings (e.g., tests skipped). Zero noisy deprecation warnings.
13
+ - **Reliability**: New releases do not regress existing behavior; the automated test suite passes (`node --test`).
14
+ - **Adoption Metric**: Track installations (npm downloads) and successful release script exits.
15
+
16
+ ## 4. Personas
17
+ 1. **Solo Maintainer** – wants painless semantic releases without memorizing commands.
18
+ 2. **Team Lead** – enforces commit standards across contributors and ensures releases produce accurate changelogs.
19
+ 3. **DevOps/CI Engineer** – integrates Commiter’s release command into CI pipelines and expects deterministic, machine-readable output.
20
+
21
+ ## 5. Key Features
22
+ - **Setup CLI (`index.js`)**
23
+ - Installs dev dependencies (`standard-version`, `commitlint`, `husky`).
24
+ - Configures package scripts (`npm run release`, `release:major/minor/patch`).
25
+ - Creates Husky hooks and commitlint configuration.
26
+ - Generates release helper script and ensures executable permissions (POSIX-friendly).
27
+ - **Release Helper (`scripts/release.js`)**
28
+ - Detects release type from CLI args or npm context.
29
+ - Runs project tests via detected package manager before releasing.
30
+ - Invokes `standard-version` with additional flags (e.g., preload patch for deprecated APIs).
31
+ - **Preload Patching (`scripts/preload/fs-f-ok.cjs`)**
32
+ - Hooks Node’s module loader to transparently replace deprecated `fs.F_OK` usages in `standard-version` without altering `node_modules`.
33
+ - **Testing**
34
+ - Suite executed via `node --test` covers setup utilities, release argument parsing, and the preload patch.
35
+
36
+ ## 6. Functional Requirements
37
+ 1. Running `npx @programinglive/commiter` inside a Node project should configure release tooling without manual edits.
38
+ 2. `npm run release` must:
39
+ - Run the project’s tests (if defined) with the correct package manager.
40
+ - Execute `standard-version`, passing the preload script via `NODE_OPTIONS`.
41
+ - Exit with non-zero status if tests or standard-version commands fail.
42
+ 3. CLI should provide friendly console output (status icons, instructions).
43
+ 4. The preload script must eliminate `[DEP0176] fs.F_OK` warnings on supported Node versions.
44
+ 5. Documentation (README, PRD, release notes) remains shipped with the package.
45
+
46
+ ## 7. Non-Functional Requirements
47
+ - **Compatibility**: Supports Node.js 18+ (aligning with dependencies); tested on Windows/macOS/Linux.
48
+ - **Maintainability**: Avoid direct edits to dependencies; wrap behavior in Commiter-controlled modules.
49
+ - **Performance**: Release command overhead minimal (<1s additional startup time) beyond running tests and standard-version.
50
+ - **Security**: No network requests during CLI execution beyond npm installs triggered by the user.
51
+
52
+ ## 8. User Journeys
53
+ 1. **Initial Setup**
54
+ - Run `npx @programinglive/commiter`.
55
+ - Tool installs dependencies, updates `package.json`, and scaffolds Husky hooks.
56
+ - Maintainer confirms success message and new scripts.
57
+ 2. **Standard Release**
58
+ - Developer runs `npm run release minor`.
59
+ - Commiter runs tests, ensures preload patch prevents deprecation warnings, executes `standard-version`.
60
+ - Release completes with updated changelog and git tag.
61
+ 3. **CI Pipeline**
62
+ - CI job executes `npm run release -- --prerelease beta`.
63
+ - Logs show tests executed, no deprecation warnings, and release artifacts generated.
64
+
65
+ ## 9. Milestones & Roadmap
66
+ - **v1.1.x** (current)
67
+ - Deprecation warning mitigation, enhanced tests, PRD + release documentation.
68
+ - **Future Considerations**
69
+ - Support for monorepo detection (Lerna/Nx) to run scoped releases.
70
+ - Optional lint/test command customization via config file.
71
+ - Telemetry opt-in for release statistics (downloads, success rates).
72
+
73
+ ## 10. Risks & Mitigations
74
+ - **Dependency API Changes**: Upstream packages may alter file paths. Mitigate with targeted module resolution and tests.
75
+ - **User Customization Conflicts**: Custom scripts might skip tests. Provide documentation for overriding behavior.
76
+ - **Platform Differences**: Windows path quoting; addressed via `buildPreloadFlag` helper.
77
+
78
+ ## 11. Release & QA Checklist
79
+ - [x] `npm test` (alias for `node --test`) passes.
80
+ - [x] Manual run of `node scripts/release.js --help` shows no `[DEP0176]` warning.
81
+ - [ ] Update `CHANGELOG.md` (handled by standard-version during actual release).
82
+ - [ ] Verify README reflects latest setup instructions before shipping.
83
+
84
+ ## 12. Appendices
85
+ - **Release Notes**: See `docs/release-notes/` for per-change summaries.
86
+ - **Testing Artifacts**: `test/` directory contains Node test runner suites.
package/README.md CHANGED
@@ -116,11 +116,12 @@ npm run release
116
116
 
117
117
  ## What Happens During Release?
118
118
 
119
- 1. πŸ“Š Analyzes commits since last release
120
- 2. πŸ”’ Bumps version in `package.json`
121
- 3. πŸ“ Updates `CHANGELOG.md` with icons
122
- 4. 🏷️ Creates a git tag
123
- 5. πŸ’Ύ Commits changes with format: `chore(release): v1.2.3 πŸš€`
119
+ 1. πŸ§ͺ Detects your package manager and runs the `test` script automatically
120
+ 2. πŸ“Š Analyzes commits since last release
121
+ 3. πŸ”’ Bumps version in `package.json`
122
+ 4. πŸ“ Updates `CHANGELOG.md` with icons
123
+ 5. 🏷️ Creates a git tag
124
+ 6. πŸ’Ύ Commits changes with format: `chore(release): v1.2.3 πŸš€`
124
125
 
125
126
  ## Push Your Release
126
127
 
@@ -0,0 +1,47 @@
1
+ # PRD: Eliminate `fs.F_OK` Deprecation Warning During Releases
2
+
3
+ ## Overview
4
+ `standard-version@9.5.0` uses the deprecated `fs.F_OK` constant when ensuring the changelog file exists. When `scripts/release.js` executed, Node.js v20+ surfaced `[DEP0176]` warnings, creating noise in CI/CD logs and confusing maintainers about potential breakages.
5
+
6
+ ## Goals
7
+ - Prevent the deprecation warning without forking or manually editing `node_modules`.
8
+ - Keep the mitigation self-contained within the Commiter codebase so dependency upgrades remain safe.
9
+ - Preserve existing release behaviour (tests, standard-version invocation, CLI API).
10
+
11
+ ## Non-Goals
12
+ - Upgrading `standard-version` or other dependencies.
13
+ - Patching unrelated lifecycle scripts that do not trigger the warning.
14
+ - Changing user-facing configuration or CLI commands.
15
+
16
+ ## Target Users
17
+ - Repository maintainers who run `npm run release*` scripts and expect clean logs.
18
+ - CI pipelines that rely on warning-free output to detect regressions.
19
+
20
+ ## Functional Requirements
21
+ 1. Release commands must execute without emitting the `fs.F_OK` deprecation warning.
22
+ 2. The fix must apply automatically whenever the bundled release helper runs.
23
+ 3. Commiter must continue to run project tests prior to executing `standard-version`.
24
+ 4. All existing automated tests must remain green.
25
+
26
+ ## Technical Approach
27
+ - Introduce `scripts/preload/fs-f-ok.cjs` that monkey patches Node's module loader for `standard-version/lib/lifecycles/changelog`, rewriting `fs.F_OK` to `fs.constants.F_OK` in-memory before the module executes.
28
+ - Ensure every Commiter-managed release process uses the preload script by appending `--require <preload>` to `NODE_OPTIONS` for the spawned `standard-version` child process.
29
+ - Retain a local require of the preload script in `scripts/release.js` so unit tests that run in-process also benefit.
30
+
31
+ ## Success Metrics
32
+ - Running `node scripts/release.js --help` (or any release command) no longer emits `[DEP0176]`.
33
+ - Automated test suite (`npm test`) passes without new failures.
34
+
35
+ ## Testing Plan
36
+ - Extend test coverage with `test/fs-f-ok-preload.test.js` to verify `fs.F_OK` is aligned with `fs.constants.F_OK` after loading the release helper.
37
+ - Update existing release unit tests to assert the spawn sequence now includes the `--require` preload flag.
38
+ - Execute `node --test` locally and in CI to validate.
39
+
40
+ ## Risks & Mitigations
41
+ - **Upstream Changes**: Future `standard-version` versions may restructure files. Mitigate by scoping the preload to the exact module path and gracefully skipping if no replacement is required.
42
+ - **Environment Variable Collisions**: Appending to `NODE_OPTIONS` could conflict with user-provided values. Mitigate by concatenating (instead of overriding) existing options.
43
+ - **Windows Path Quoting**: Preload flag builder escapes quotes and wraps paths containing spaces to avoid spawn failures on Windows.
44
+
45
+ ## Rollout Plan
46
+ - Ship change in the next patch release (v1.1.x).
47
+ - Communicate via release notes and CHANGELOG updates once published.
@@ -0,0 +1,33 @@
1
+ # Commiter Release Notes
2
+
3
+ This document summarizes every published version of `@programinglive/commiter`. Refer to the generated [CHANGELOG](../../CHANGELOG.md) for commit-level details.
4
+
5
+ | Version | Date | Highlights |
6
+ |---------|------|------------|
7
+ | 1.1.0 | 2025-10-29 | πŸ“ Documentation – clarified release automation flow. |
8
+ | 1.0.12 | 2025-10-29 | ✨ Feature – autodetects project test command before releasing. |
9
+ | 1.0.11 | 2025-10-29 | πŸ“ Documentation – added project status and download badges. |
10
+ | 1.0.10 | 2025-10-29 | Maintenance release; no additional notes provided. |
11
+ | 1.0.9 | 2025-10-29 | ✨ Feature – introduced a new capability (see changelog commit `e1603c1`). |
12
+ | 1.0.8 | 2025-10-29 | ✨ Feature – added release helper script and tests. |
13
+ | 1.0.7 | 2025-10-29 | ✨ Feature – added release helper script and tests. |
14
+ | 1.0.6 | 2025-10-19 | Maintenance release; no additional notes provided. |
15
+ | 1.0.5 | 2025-10-19 | πŸ› Bug Fix – allowed release commits to include emoji. |
16
+ | 1.0.4 | 2025-10-19 | πŸ› Bug Fix – ensured safe default test script for initial release. |
17
+ | 1.0.3 | 2025-10-19 | Maintenance release; no additional notes provided. |
18
+ | 1.0.2 | 2025-10-19 | Maintenance release; no additional notes provided. |
19
+ | 1.0.1 | 2025-10-18 | πŸ› Bug Fix – aligned commitlint config with project module type. |
20
+ | 1.0.0 | 2025-10-17 | ✨ Initial release – bootstrapped conventional release tooling; added community docs and metadata. |
21
+
22
+ ## fs.F_OK Deprecation Warning Fix (Unreleased)
23
+ - Eliminated the `[DEP0176] fs.F_OK` warning emitted during release commands by injecting a preload script that transparently rewrites `fs.F_OK` usage inside `standard-version`.
24
+ - Ensured the preload script runs for both in-process unit tests and the child process that executes `standard-version` by appending a `--require` flag to `NODE_OPTIONS`.
25
+ - Updated the test suite to cover the preload behaviour and the adjusted release workflow, switching the project to Node’s built-in test runner (`node --test`).
26
+
27
+ ### Impact
28
+ - Release logs are now warning-free, reducing CI noise and operator confusion.
29
+ - Future dependency updates remain safe because no files under `node_modules` are modified.
30
+ - The new tests guard against regressions in the preload integration.
31
+
32
+ ### Testing
33
+ - `node --test`
@@ -0,0 +1,14 @@
1
+ # Release Notes: Fix fs.F_OK Deprecation Warning
2
+
3
+ ## Summary
4
+ - Eliminated the `[DEP0176] fs.F_OK` warning emitted during release commands by injecting a preload script that transparently rewrites `fs.F_OK` usage inside `standard-version`.
5
+ - Ensured the preload script runs for both in-process unit tests and the child process that executes `standard-version` by appending a `--require` flag to `NODE_OPTIONS`.
6
+ - Updated the test suite to cover the preload behaviour and the adjusted release workflow, switching the project to Node’s built-in test runner (`node --test`).
7
+
8
+ ## Impact
9
+ - Release logs are now warning-free, reducing CI noise and operator confusion.
10
+ - Future dependency updates remain safe because no files under `node_modules` are modified.
11
+ - The new tests guard against regressions in the preload integration.
12
+
13
+ ## Testing
14
+ - `node --test`
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@programinglive/commiter",
3
- "version": "1.0.12",
3
+ "version": "1.1.1",
4
4
  "description": "Commiter keeps repositories release-ready by enforcing conventional commits, generating icon-rich changelog entries, and orchestrating semantic version bumps without manual toil. It bootstraps Husky hooks, commitlint rules, and release scripts that inspect history, detect framework-specific test commands, run them automatically, tag git releases, coordinate npm publishing, surface release metrics, enforce project-specific checks, and give maintainers observability across distributed teams. Plus!",
5
5
  "main": "index.js",
6
6
  "bin": {
7
7
  "commiter": "./index.js"
8
8
  },
9
9
  "scripts": {
10
- "test": "node test/ensureSafeTestScript.test.js",
10
+ "test": "node --test",
11
11
  "prepare": "husky",
12
12
  "release": "node scripts/release.js",
13
13
  "release:major": "node scripts/release.js major",
@@ -0,0 +1,23 @@
1
+ const fs = require('fs');
2
+ const Module = require('module');
3
+
4
+ const targetPath = require.resolve('standard-version/lib/lifecycles/changelog');
5
+
6
+ if (!Module._commiterPatchedFsFok) {
7
+ const originalLoader = Module._extensions['.js'];
8
+
9
+ Module._extensions['.js'] = function patchedLoader(module, filename) {
10
+ if (filename === targetPath) {
11
+ let source = fs.readFileSync(filename, 'utf8');
12
+ if (source.includes('fs.F_OK')) {
13
+ source = source.replace(/fs\.F_OK/g, 'fs.constants.F_OK');
14
+ }
15
+ module._compile(source, filename);
16
+ return;
17
+ }
18
+
19
+ return originalLoader(module, filename);
20
+ };
21
+
22
+ Module._commiterPatchedFsFok = true;
23
+ }
@@ -4,6 +4,11 @@ const { spawnSync } = require('child_process');
4
4
  const fs = require('fs');
5
5
  const path = require('path');
6
6
 
7
+ const fsFokPreloadPath = path.join(__dirname, 'preload', 'fs-f-ok.cjs');
8
+ const FS_FOK_PRELOAD_FLAG = buildPreloadFlag(fsFokPreloadPath);
9
+
10
+ require('./preload/fs-f-ok.cjs');
11
+
7
12
  const VALID_RELEASE_TYPES = new Set([
8
13
  'major',
9
14
  'minor',
@@ -141,8 +146,10 @@ function runRelease({ argv = process.argv, env = process.env, spawn = spawnSync
141
146
  }
142
147
 
143
148
  const standardVersionBin = require.resolve('standard-version/bin/cli.js');
149
+ const childEnv = appendPreloadToNodeOptions(env, FS_FOK_PRELOAD_FLAG);
144
150
  return spawn(process.execPath, [standardVersionBin, ...standardVersionArgs], {
145
- stdio: 'inherit'
151
+ stdio: 'inherit',
152
+ env: childEnv
146
153
  });
147
154
  }
148
155
 
@@ -169,3 +176,18 @@ module.exports = {
169
176
  runProjectTests,
170
177
  runRelease
171
178
  };
179
+
180
+ function buildPreloadFlag(filePath) {
181
+ const resolved = path.resolve(filePath);
182
+ const escaped = resolved.includes(' ')
183
+ ? `"${resolved.replace(/"/g, '\"')}"`
184
+ : resolved;
185
+ return `--require ${escaped}`;
186
+ }
187
+
188
+ function appendPreloadToNodeOptions(env, preloadFlag) {
189
+ const nextEnv = { ...env };
190
+ const existing = typeof nextEnv.NODE_OPTIONS === 'string' ? nextEnv.NODE_OPTIONS.trim() : '';
191
+ nextEnv.NODE_OPTIONS = existing ? `${existing} ${preloadFlag}` : preloadFlag;
192
+ return nextEnv;
193
+ }