@programinglive/commiter 1.0.2 → 1.0.4

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,15 @@
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.0.4](https://github.com/programinglive/commiter/compare/v1.0.3...v1.0.4) (2025-10-19)
6
+
7
+
8
+ ### 🐛 Bug Fixes
9
+
10
+ * ensure safe test default for initial release ([27d2ee3](https://github.com/programinglive/commiter/commit/27d2ee35d1e558ef459a61e41627305997621392))
11
+
12
+ ### [1.0.3](https://github.com/programinglive/commiter/compare/v1.0.2...v1.0.3) (2025-10-19)
13
+
5
14
  ### [1.0.2](https://github.com/programinglive/commiter/compare/v1.0.1...v1.0.2) (2025-10-19)
6
15
 
7
16
  ### [1.0.1](https://github.com/programinglive/commiter/compare/v1.0.0...v1.0.1) (2025-10-18)
package/README.md CHANGED
@@ -158,6 +158,8 @@ If this is your first release and you don't have a version tag yet:
158
158
  npm run release -- --first-release
159
159
  ```
160
160
 
161
+ Running the setup command ensures the default `npm test` script is `echo "No tests specified"`, preventing the Husky `pre-commit` hook from failing during this initial release. Replace it with your real test command once available.
162
+
161
163
  ### Dry run
162
164
 
163
165
  To see what would happen without making changes:
package/index.js CHANGED
@@ -11,6 +11,14 @@ const { execSync } = require('child_process');
11
11
  const fs = require('fs');
12
12
  const path = require('path');
13
13
 
14
+ function ensureSafeTestScript(scripts = {}) {
15
+ const defaultFailingTestScript = 'echo "Error: no test specified" && exit 1';
16
+ if (!scripts.test || scripts.test === defaultFailingTestScript) {
17
+ scripts.test = 'echo "No tests specified"';
18
+ }
19
+ return scripts;
20
+ }
21
+
14
22
  function setupCommiter() {
15
23
  console.log('🚀 Setting up Commiter...\n');
16
24
 
@@ -31,8 +39,8 @@ function setupCommiter() {
31
39
  const packageJsonPath = path.join(process.cwd(), 'package.json');
32
40
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
33
41
 
42
+ packageJson.scripts = ensureSafeTestScript(packageJson.scripts || {});
34
43
  // Add scripts
35
- packageJson.scripts = packageJson.scripts || {};
36
44
  packageJson.scripts.prepare = 'husky';
37
45
  packageJson.scripts.release = 'standard-version';
38
46
  packageJson.scripts['release:major'] = 'npm run release -- --release-as major';
@@ -112,4 +120,4 @@ if (require.main === module) {
112
120
  setupCommiter();
113
121
  }
114
122
 
115
- module.exports = { setupCommiter };
123
+ module.exports = { setupCommiter, ensureSafeTestScript };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@programinglive/commiter",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Commit convention tooling for standard-version releases with beautiful changelogs",
5
5
  "main": "index.js",
6
6
  "bin": {
7
7
  "commiter": "./index.js"
8
8
  },
9
9
  "scripts": {
10
- "test": "echo \"No tests specified\"",
10
+ "test": "node test/ensureSafeTestScript.test.js",
11
11
  "prepare": "husky",
12
12
  "release": "standard-version",
13
13
  "release:major": "npm run release -- --release-as major",