changelog-machine 1.0.2 → 1.1.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.
@@ -2,6 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.printVersion = void 0;
4
4
  const printVersion = () => {
5
- return console.log(`${process.env.npm_package_name} v${process.env.npm_package_version}`);
5
+ if (typeof process.env.npm_package_version === 'undefined') {
6
+ console.warn('Warning: No version information found.');
7
+ }
8
+ else {
9
+ console.log(`${process.env.npm_package_name} v${process.env.npm_package_version}`);
10
+ }
6
11
  };
7
12
  exports.printVersion = printVersion;
package/lib/cli/index.js CHANGED
@@ -19,7 +19,12 @@ const printMarkdown_1 = require("./commands/printMarkdown");
19
19
  const printVersion_1 = require("./commands/printVersion");
20
20
  const options_1 = require("./config/options");
21
21
  const readConfigFile_1 = require("./config/readConfigFile");
22
+ const async_1 = require("../core/async");
22
23
  const run = () => __awaiter(void 0, void 0, void 0, function* () {
24
+ if (!(0, async_1.checkPackageJsonExists)()) {
25
+ console.error('Error: package.json does not exist.');
26
+ process.exit(1);
27
+ }
23
28
  const args = (0, minimist_1.default)(process.argv.slice(2), options_1.flags);
24
29
  if (args.version) {
25
30
  (0, printVersion_1.printVersion)();
@@ -5,4 +5,5 @@ declare const execAsync: typeof exec.__promisify__;
5
5
  declare const writeFileAsync: typeof writeFile.__promisify__;
6
6
  declare const readFileAsync: typeof readFile.__promisify__;
7
7
  declare const outputFileAsync: (path: string, contents: string) => Promise<void>;
8
- export { execAsync, writeFileAsync, readFileAsync, outputFileAsync };
8
+ declare const checkPackageJsonExists: () => boolean;
9
+ export { checkPackageJsonExists, execAsync, outputFileAsync, readFileAsync, writeFileAsync, };
package/lib/core/async.js CHANGED
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.outputFileAsync = exports.readFileAsync = exports.writeFileAsync = exports.execAsync = void 0;
12
+ exports.writeFileAsync = exports.readFileAsync = exports.outputFileAsync = exports.execAsync = exports.checkPackageJsonExists = void 0;
13
13
  const child_process_1 = require("child_process");
14
14
  const fs_1 = require("fs");
15
15
  const path_1 = require("path");
@@ -26,3 +26,7 @@ const outputFileAsync = (path, contents) => __awaiter(void 0, void 0, void 0, fu
26
26
  yield writeFileAsync(path, contents);
27
27
  });
28
28
  exports.outputFileAsync = outputFileAsync;
29
+ const checkPackageJsonExists = () => {
30
+ return (0, fs_1.existsSync)('package.json');
31
+ };
32
+ exports.checkPackageJsonExists = checkPackageJsonExists;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "changelog-machine",
3
3
  "displayName": "Changelog Machine",
4
- "version": "1.0.2",
4
+ "version": "1.1.0",
5
5
  "description": "Changelog generator based on Git commit messages and tags",
6
6
  "main": "./lib/index.js",
7
7
  "module": "./lib/index.js",
@@ -26,7 +26,12 @@
26
26
  "engines": {
27
27
  "node": ">=4.2.0"
28
28
  },
29
- "author": "Philipp Kief",
29
+ "author": {
30
+ "name": "Philipp Kief",
31
+ "email": "philipp.kief@gmx.de",
32
+ "url": "https://pkief.github.io"
33
+ },
34
+ "funding": "https://github.com/sponsors/pkief",
30
35
  "license": "MIT",
31
36
  "bugs": {
32
37
  "url": "https://github.com/PKief/changelog-machine/issues"