bunset 1.0.1 → 1.0.3

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/CHANGELOG.md +12 -0
  2. package/package.json +9 -1
  3. package/src/cli.ts +30 -20
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.3
4
+
5
+ ### Bug Fixes
6
+
7
+ - show friendly error for unrecognized CLI options
8
+
9
+ ## 1.0.2
10
+
11
+ ### Bug Fixes
12
+
13
+ - link back to github
14
+
3
15
  ## 1.0.1
4
16
 
5
17
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunset",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "bin": {
@@ -21,6 +21,14 @@
21
21
  "CHANGELOG.md",
22
22
  "src"
23
23
  ],
24
+ "homepage": "https://github.com/sroussey/bunset#readme",
25
+ "bugs": {
26
+ "url": "https://github.com/sroussey/bunset/issues"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/sroussey/bunset.git"
31
+ },
24
32
  "publishConfig": {
25
33
  "access": "public"
26
34
  },
package/src/cli.ts CHANGED
@@ -82,26 +82,36 @@ export function resolveOptions(
82
82
  isWs: boolean,
83
83
  config: Partial<CliOptions> = {},
84
84
  ): CliOptions | Promise<CliOptions> {
85
- const { values } = parseArgs({
86
- args: Bun.argv.slice(2),
87
- options: {
88
- all: { type: "boolean", default: false },
89
- changed: { type: "boolean", default: false },
90
- patch: { type: "boolean", default: false },
91
- minor: { type: "boolean", default: false },
92
- major: { type: "boolean", default: false },
93
- commit: { type: "boolean", default: true },
94
- tag: { type: "boolean", default: true },
95
- "per-package-tags": { type: "boolean", default: false },
96
- sections: { type: "string" },
97
- "dry-run": { type: "boolean", default: false },
98
- "filter-by-package": { type: "boolean", default: true },
99
- "tag-prefix": { type: "string" },
100
- debug: { type: "boolean", default: false },
101
- help: { type: "boolean", short: "h", default: false },
102
- },
103
- strict: true,
104
- });
85
+ let values: ReturnType<typeof parseArgs>["values"];
86
+ try {
87
+ ({ values } = parseArgs({
88
+ args: Bun.argv.slice(2),
89
+ options: {
90
+ all: { type: "boolean", default: false },
91
+ changed: { type: "boolean", default: false },
92
+ patch: { type: "boolean", default: false },
93
+ minor: { type: "boolean", default: false },
94
+ major: { type: "boolean", default: false },
95
+ commit: { type: "boolean", default: true },
96
+ tag: { type: "boolean", default: true },
97
+ "per-package-tags": { type: "boolean", default: false },
98
+ sections: { type: "string" },
99
+ "dry-run": { type: "boolean", default: false },
100
+ "filter-by-package": { type: "boolean", default: true },
101
+ "tag-prefix": { type: "string" },
102
+ debug: { type: "boolean", default: false },
103
+ help: { type: "boolean", short: "h", default: false },
104
+ },
105
+ strict: true,
106
+ }));
107
+ } catch (err) {
108
+ if (err instanceof TypeError && (err as any).code === "ERR_PARSE_ARGS_UNKNOWN_OPTION") {
109
+ console.error(err.message);
110
+ console.error("\nRun bunset --help to see available options.");
111
+ process.exit(1);
112
+ }
113
+ throw err;
114
+ }
105
115
 
106
116
  if (values.help) {
107
117
  printHelp();