@commitlint/prompt-cli 21.2.3 → 21.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.
Files changed (3) hide show
  1. package/README.md +6 -0
  2. package/cli.js +11 -1
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -14,4 +14,10 @@ git add .
14
14
  commit
15
15
  ```
16
16
 
17
+ To load the config from a custom path, pass `--config` (or `-g`):
18
+
19
+ ```sh
20
+ commit --config ./config/commitlint.config.js
21
+ ```
22
+
17
23
  A full usage guide is available at [docs/prompt](https://commitlint.js.org/guides/use-prompt).
package/cli.js CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env node
2
+ import { parseArgs } from "node:util";
3
+
2
4
  import { prompter } from "@commitlint/prompt";
3
5
  import inquirer from "inquirer";
4
6
  import { x } from "tinyexec";
@@ -10,6 +12,14 @@ main().catch((err) => {
10
12
  });
11
13
 
12
14
  function main() {
15
+ const { values: flags } = parseArgs({
16
+ options: {
17
+ config: { type: "string", short: "g" },
18
+ },
19
+ strict: false,
20
+ });
21
+ const file = typeof flags.config === "string" ? flags.config : undefined;
22
+
13
23
  return isStageEmpty()
14
24
  .then((empty) => {
15
25
  if (empty) {
@@ -17,7 +27,7 @@ function main() {
17
27
  process.exit(1);
18
28
  }
19
29
  })
20
- .then(() => prompter(inquirer, commit));
30
+ .then(() => prompter(inquirer, commit, { file }));
21
31
  }
22
32
 
23
33
  function isStageEmpty() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commitlint/prompt-cli",
3
- "version": "21.2.3",
4
- "gitHead": "95d40569d2592bf9719bc27da2d51fc6b801e4ef",
3
+ "version": "21.3.0",
4
+ "gitHead": "c0bce295b8c1fbc4f692ec05fb760c8b157fb708",
5
5
  "description": "commit prompt using commitlint.config.js",
6
6
  "keywords": [
7
7
  "commitlint",
@@ -32,7 +32,7 @@
32
32
  "pkg": "pkg-check --skip-main"
33
33
  },
34
34
  "dependencies": {
35
- "@commitlint/prompt": "^21.2.3",
35
+ "@commitlint/prompt": "^21.3.0",
36
36
  "inquirer": "^9.2.15",
37
37
  "tinyexec": "^1.0.0"
38
38
  },