fork-version 1.4.95 → 1.5.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.
- package/CHANGELOG.md +16 -0
- package/README.md +71 -59
- package/dist/{chunk-7ZOLJADN.js → chunk-6F6V3HWV.js} +72 -54
- package/dist/chunk-6F6V3HWV.js.map +1 -0
- package/dist/{chunk-6SI2AHBP.cjs → chunk-SAIF32GN.cjs} +73 -55
- package/dist/chunk-SAIF32GN.cjs.map +1 -0
- package/dist/cli.cjs +9 -9
- package/dist/cli.js +1 -1
- package/dist/index.cjs +11 -11
- package/dist/index.d.cts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +1 -1
- package/package.json +17 -7
- package/dist/chunk-6SI2AHBP.cjs.map +0 -1
- package/dist/chunk-7ZOLJADN.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Fork Version
|
|
2
2
|
|
|
3
|
+
## 1.5.0 (2024-10-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add release as support ([9ed9c19](https://github.com/eglavin/fork-version/commit/9ed9c19d8b1b8bad94fe01a7eb7559af02f8084f))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## 1.4.96 (2024-10-20)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Docs
|
|
15
|
+
|
|
16
|
+
* align cli helper text ([#73](https://github.com/eglavin/fork-version/issues/73)) ([ca13862](https://github.com/eglavin/fork-version/commit/ca1386244dc0ac4a9ed71904d4eaa1471d8d21a2))
|
|
17
|
+
|
|
18
|
+
|
|
3
19
|
## 1.4.95 (2024-10-06)
|
|
4
20
|
|
|
5
21
|
|
package/README.md
CHANGED
|
@@ -85,48 +85,49 @@ Usage:
|
|
|
85
85
|
$ fork-version [options]
|
|
86
86
|
|
|
87
87
|
Commands:
|
|
88
|
-
--help
|
|
89
|
-
--version
|
|
90
|
-
--inspect-version
|
|
88
|
+
--help Show this help message.
|
|
89
|
+
--version Show the current version of Fork-Version.
|
|
90
|
+
--inspect-version If set, Fork-Version will print the current project version and exit.
|
|
91
91
|
|
|
92
92
|
Options:
|
|
93
|
-
--file, -F
|
|
94
|
-
--glob, -G
|
|
95
|
-
--path, -P
|
|
96
|
-
--changelog
|
|
97
|
-
--header
|
|
98
|
-
--tag-prefix
|
|
99
|
-
--pre-release
|
|
100
|
-
--pre-release-tag
|
|
101
|
-
--current-version
|
|
102
|
-
--next-version
|
|
93
|
+
--file, -F List of the files to be updated. [Default: ["bower.json", "deno.json", "jsr.json", "manifest.json", "npm-shrinkwrap.json", "package-lock.json", "package.json"]]
|
|
94
|
+
--glob, -G Glob pattern to match files to be updated.
|
|
95
|
+
--path, -P The path Fork-Version will run from. [Default: process.cwd()]
|
|
96
|
+
--changelog Name of the changelog file. [Default: "CHANGELOG.md"]
|
|
97
|
+
--header The header text for the changelog.
|
|
98
|
+
--tag-prefix Specify a prefix for the created tag. [Default: "v"]
|
|
99
|
+
--pre-release Mark this release as a pre-release.
|
|
100
|
+
--pre-release-tag Mark this release with a tagged pre-release. [Example: "alpha", "beta", "rc"]
|
|
101
|
+
--current-version If set, Fork-Version will use this version instead of trying to determine one.
|
|
102
|
+
--next-version If set, Fork-Version will attempt to update to this version, instead of incrementing using "conventional-commit".
|
|
103
|
+
--release-as Release as increments the version by the specified level. [Choices: "major", "minor", "patch"]
|
|
103
104
|
|
|
104
105
|
Flags:
|
|
105
|
-
--allow-multiple-versions
|
|
106
|
-
--commit-all
|
|
107
|
-
--changelog-all
|
|
108
|
-
--debug
|
|
109
|
-
--dry-run
|
|
110
|
-
--silent
|
|
111
|
-
--git-tag-fallback
|
|
112
|
-
--sign
|
|
113
|
-
--verify
|
|
106
|
+
--allow-multiple-versions Don't throw an error if multiple versions are found in the given files. [Default: true]
|
|
107
|
+
--commit-all Commit all changes, not just files updated by Fork-Version.
|
|
108
|
+
--changelog-all If this flag is set, all default commit types will be added to the changelog.
|
|
109
|
+
--debug Output debug information.
|
|
110
|
+
--dry-run No output will be written to disk or committed.
|
|
111
|
+
--silent Run without logging to the terminal.
|
|
112
|
+
--git-tag-fallback If unable to find a version in the given files, fallback and attempt to use the latest git tag. [Default: true]
|
|
113
|
+
--sign If true, git will sign the commit with the systems GPG key.
|
|
114
|
+
--verify If true, git will run user defined git hooks before committing.
|
|
114
115
|
|
|
115
116
|
To negate a flag you can prefix it with "no-", for example "--no-git-tag-fallback" will not fallback to the latest git tag.
|
|
116
117
|
|
|
117
118
|
Skip Steps:
|
|
118
|
-
--skip-bump
|
|
119
|
-
--skip-changelog
|
|
120
|
-
--skip-commit
|
|
121
|
-
--skip-tag
|
|
119
|
+
--skip-bump Skip the version bump step.
|
|
120
|
+
--skip-changelog Skip updating the changelog.
|
|
121
|
+
--skip-commit Skip committing the changes.
|
|
122
|
+
--skip-tag Skip tagging the commit.
|
|
122
123
|
|
|
123
124
|
Conventional Changelog Overrides:
|
|
124
|
-
--commit-url-format
|
|
125
|
-
--compare-url-format
|
|
126
|
-
--issue-url-format
|
|
127
|
-
--user-url-format
|
|
128
|
-
--release-commit-message-format
|
|
129
|
-
--release-message-suffix
|
|
125
|
+
--commit-url-format Override the default commit URL format.
|
|
126
|
+
--compare-url-format Override the default compare URL format.
|
|
127
|
+
--issue-url-format Override the default issue URL format.
|
|
128
|
+
--user-url-format Override the default user URL format.
|
|
129
|
+
--release-commit-message-format Override the default release commit message format.
|
|
130
|
+
--release-message-suffix Add a suffix to the end of the release message.
|
|
130
131
|
|
|
131
132
|
Examples:
|
|
132
133
|
$ fork-version
|
|
@@ -232,33 +233,34 @@ Alternatively you can define your config using a key in your `package.json` file
|
|
|
232
233
|
|
|
233
234
|
#### Config Properties
|
|
234
235
|
|
|
235
|
-
| Property | Type | Default | Description
|
|
236
|
-
| :---------------------------------------------------- | :--------------- | :---------------------- |
|
|
237
|
-
| inspectVersion | boolean | - | Print the current version and exits
|
|
238
|
-
| [files](#configfiles) | Array\<string> | `["package.json", ...]` | List of the files to be updated
|
|
239
|
-
| [glob](#configglob) | string | - | Glob pattern to match files to be updated
|
|
240
|
-
| path | string | `process.cwd()` | The path
|
|
241
|
-
| changelog | string | `CHANGELOG.md` | Name of the changelog file
|
|
242
|
-
| header | string | `# Changelog...` | The header text for the changelog
|
|
243
|
-
| [tagPrefix](#configtagprefix) | string | `v` | Prefix for the created tag
|
|
244
|
-
| [preRelease](#configprerelease) | string / boolean | - | Make a pre-release with optional label if given value is a string
|
|
245
|
-
| currentVersion | string | - | Use this version instead of trying to determine one
|
|
246
|
-
| nextVersion | string | - | Attempt to update to this version, instead of incrementing using "conventional-commit"
|
|
247
|
-
|
|
|
248
|
-
|
|
|
249
|
-
|
|
|
250
|
-
|
|
|
251
|
-
|
|
|
252
|
-
|
|
|
253
|
-
|
|
|
254
|
-
|
|
|
255
|
-
|
|
|
256
|
-
|
|
|
257
|
-
|
|
|
258
|
-
|
|
|
259
|
-
|
|
|
260
|
-
|
|
|
261
|
-
|
|
|
236
|
+
| Property | Type | Default | Description |
|
|
237
|
+
| :---------------------------------------------------- | :--------------- | :---------------------- | :------------------------------------------------------------------------------------------------------------------ |
|
|
238
|
+
| inspectVersion | boolean | - | Print the current version and exits |
|
|
239
|
+
| [files](#configfiles) | Array\<string> | `["package.json", ...]` | List of the files to be updated |
|
|
240
|
+
| [glob](#configglob) | string | - | Glob pattern to match files to be updated |
|
|
241
|
+
| path | string | `process.cwd()` | The path Fork-Version will run from |
|
|
242
|
+
| changelog | string | `CHANGELOG.md` | Name of the changelog file |
|
|
243
|
+
| header | string | `# Changelog...` | The header text for the changelog |
|
|
244
|
+
| [tagPrefix](#configtagprefix) | string | `v` | Prefix for the created tag |
|
|
245
|
+
| [preRelease](#configprerelease) | string / boolean | - | Make a pre-release with optional label if given value is a string |
|
|
246
|
+
| currentVersion | string | - | Use this version instead of trying to determine one |
|
|
247
|
+
| nextVersion | string | - | Attempt to update to this version, instead of incrementing using "conventional-commit" |
|
|
248
|
+
| [releaseAs](#configreleaseas) | string | - | Release as increments the version by the specified level. Overrides the default behaviour of "conventional-commit". |
|
|
249
|
+
| allowMultipleVersions | boolean | true | Don't throw an error if multiple versions are found in the given files. |
|
|
250
|
+
| commitAll | boolean | false | Commit all changes, not just files updated by Fork-Version |
|
|
251
|
+
| changelogAll | boolean | false | If this flag is set, all default commit types will be added to the changelog, not just `feat` and `fix`. |
|
|
252
|
+
| debug | boolean | false | Output debug information |
|
|
253
|
+
| dryRun | boolean | false | No output will be written to disk or committed |
|
|
254
|
+
| silent | boolean | false | Run without logging to the terminal |
|
|
255
|
+
| gitTagFallback | boolean | true | If unable to find a version in the given files, fallback and attempt to use the latest git tag |
|
|
256
|
+
| sign | boolean | false | Sign the commit with the systems GPG key |
|
|
257
|
+
| verify | boolean | false | Run user defined git hooks before committing |
|
|
258
|
+
| skipBump | boolean | false | Skip the bump step |
|
|
259
|
+
| skipChangelog | boolean | false | Skip the changelog step |
|
|
260
|
+
| skipCommit | boolean | false | Skip the commit step |
|
|
261
|
+
| skipTag | boolean | false | Skip the tag step |
|
|
262
|
+
| [changelogPresetConfig](#configchangelogpresetconfig) | object | {} | Override defaults from the "conventional-changelog-conventionalcommits" preset configuration |
|
|
263
|
+
| releaseMessageSuffix | string | - | Add a suffix to the end of the release message |
|
|
262
264
|
|
|
263
265
|
##### config.files
|
|
264
266
|
|
|
@@ -323,6 +325,16 @@ Fork-Version uses [meow](https://github.com/sindresorhus/meow) to parse cli argu
|
|
|
323
325
|
| `fork-version --pre-release` | `1.2.3-0` |
|
|
324
326
|
| `fork-version --pre-release-tag alpha` | `1.2.3-alpha-0` |
|
|
325
327
|
|
|
328
|
+
##### config.releaseAs
|
|
329
|
+
|
|
330
|
+
Allows you to override the default versioning behaviour of Fork-Version and increment by the specified level. For example if the current version is `1.2.3` and you run Fork-Version with one of the following arguments, the version will be incremented as shown below.
|
|
331
|
+
|
|
332
|
+
| Example Value | Version Created |
|
|
333
|
+
|:--------------|:----------------|
|
|
334
|
+
| `major` | 2.0.0 |
|
|
335
|
+
| `minor` | 1.3.0 |
|
|
336
|
+
| `patch` | 1.2.4 |
|
|
337
|
+
|
|
326
338
|
##### config.changelogPresetConfig
|
|
327
339
|
|
|
328
340
|
Fork-Version uses the [conventional changelog config spec](https://github.com/conventional-changelog/conventional-changelog-config-spec). The following is an excerpt of the configurable options.
|
|
@@ -78,10 +78,10 @@ var ForkConfigSchema = z.object({
|
|
|
78
78
|
// Commands
|
|
79
79
|
//
|
|
80
80
|
/**
|
|
81
|
-
* If set,
|
|
81
|
+
* If set, Fork-Version will print the current version and exit.
|
|
82
82
|
* @default false
|
|
83
83
|
*/
|
|
84
|
-
inspectVersion: z.boolean().describe("If set,
|
|
84
|
+
inspectVersion: z.boolean().describe("If set, Fork-Version will print the current version and exit."),
|
|
85
85
|
// Options
|
|
86
86
|
//
|
|
87
87
|
/**
|
|
@@ -104,13 +104,13 @@ var ForkConfigSchema = z.object({
|
|
|
104
104
|
*/
|
|
105
105
|
glob: z.string().optional().describe("Glob pattern to match files to be updated."),
|
|
106
106
|
/**
|
|
107
|
-
* The path
|
|
107
|
+
* The path Fork-Version will run from.
|
|
108
108
|
* @default
|
|
109
109
|
* ```js
|
|
110
110
|
* process.cwd()
|
|
111
111
|
* ```
|
|
112
112
|
*/
|
|
113
|
-
path: z.string().describe('The path
|
|
113
|
+
path: z.string().describe('The path Fork-Version will run from. Defaults to "process.cwd()".'),
|
|
114
114
|
/**
|
|
115
115
|
* Name of the changelog file.
|
|
116
116
|
* @default "CHANGELOG.md"
|
|
@@ -160,18 +160,26 @@ var ForkConfigSchema = z.object({
|
|
|
160
160
|
*/
|
|
161
161
|
preRelease: z.string().or(z.boolean()).optional().describe("Make a pre-release with optional label if given value is a string."),
|
|
162
162
|
/**
|
|
163
|
-
* If set,
|
|
163
|
+
* If set, Fork-Version will use this version instead of trying to determine one.
|
|
164
164
|
* @example "1.0.0"
|
|
165
165
|
* @default undefined
|
|
166
166
|
*/
|
|
167
|
-
currentVersion: z.string().optional().describe("If set,
|
|
167
|
+
currentVersion: z.string().optional().describe("If set, Fork-Version will use this version instead of trying to determine one."),
|
|
168
168
|
/**
|
|
169
|
-
* If set,
|
|
169
|
+
* If set, Fork-Version will attempt to update to this version, instead of incrementing using "conventional-commit".
|
|
170
170
|
* @example "2.0.0"
|
|
171
171
|
* @default undefined
|
|
172
172
|
*/
|
|
173
173
|
nextVersion: z.string().optional().describe(
|
|
174
|
-
'If set,
|
|
174
|
+
'If set, Fork-Version will attempt to update to this version, instead of incrementing using "conventional-commit".'
|
|
175
|
+
),
|
|
176
|
+
/**
|
|
177
|
+
* Release as increments the version by the specified level. Overrides the default behaviour of "conventional-commit".
|
|
178
|
+
* @example "major", "minor", "patch"
|
|
179
|
+
* @default undefined
|
|
180
|
+
*/
|
|
181
|
+
releaseAs: z.union([z.literal("major"), z.literal("minor"), z.literal("patch")]).optional().describe(
|
|
182
|
+
'Release as increments the version by the specified level. Overrides the default behaviour of "conventional-commit".'
|
|
175
183
|
),
|
|
176
184
|
// Flags
|
|
177
185
|
//
|
|
@@ -181,10 +189,10 @@ var ForkConfigSchema = z.object({
|
|
|
181
189
|
*/
|
|
182
190
|
allowMultipleVersions: z.boolean().describe("Don't throw an error if multiple versions are found in the given files."),
|
|
183
191
|
/**
|
|
184
|
-
* Commit all changes, not just files updated by
|
|
192
|
+
* Commit all changes, not just files updated by Fork-Version.
|
|
185
193
|
* @default false
|
|
186
194
|
*/
|
|
187
|
-
commitAll: z.boolean().describe("Commit all changes, not just files updated by
|
|
195
|
+
commitAll: z.boolean().describe("Commit all changes, not just files updated by Fork-Version."),
|
|
188
196
|
/**
|
|
189
197
|
* By default the conventional-changelog spec will only add commit types of `feat` and `fix` to the generated changelog.
|
|
190
198
|
* If this flag is set, all [default commit types](https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/238093090c14bd7d5151eb5316e635623ce633f9/versions/2.2.0/schema.json#L18)
|
|
@@ -305,48 +313,49 @@ var helperText = `Usage:
|
|
|
305
313
|
$ fork-version [options]
|
|
306
314
|
|
|
307
315
|
Commands:
|
|
308
|
-
--help
|
|
309
|
-
--version
|
|
310
|
-
--inspect-version
|
|
316
|
+
--help Show this help message.
|
|
317
|
+
--version Show the current version of Fork-Version.
|
|
318
|
+
--inspect-version If set, Fork-Version will print the current project version and exit.
|
|
311
319
|
|
|
312
320
|
Options:
|
|
313
|
-
--file, -F
|
|
314
|
-
--glob, -G
|
|
315
|
-
--path, -P
|
|
316
|
-
--changelog
|
|
317
|
-
--header
|
|
318
|
-
--tag-prefix
|
|
319
|
-
--pre-release
|
|
320
|
-
--pre-release-tag
|
|
321
|
-
--current-version
|
|
322
|
-
--next-version
|
|
321
|
+
--file, -F List of the files to be updated. [Default: ["bower.json", "deno.json", "jsr.json", "manifest.json", "npm-shrinkwrap.json", "package-lock.json", "package.json"]]
|
|
322
|
+
--glob, -G Glob pattern to match files to be updated.
|
|
323
|
+
--path, -P The path Fork-Version will run from. [Default: process.cwd()]
|
|
324
|
+
--changelog Name of the changelog file. [Default: "CHANGELOG.md"]
|
|
325
|
+
--header The header text for the changelog.
|
|
326
|
+
--tag-prefix Specify a prefix for the created tag. [Default: "v"]
|
|
327
|
+
--pre-release Mark this release as a pre-release.
|
|
328
|
+
--pre-release-tag Mark this release with a tagged pre-release. [Example: "alpha", "beta", "rc"]
|
|
329
|
+
--current-version If set, Fork-Version will use this version instead of trying to determine one.
|
|
330
|
+
--next-version If set, Fork-Version will attempt to update to this version, instead of incrementing using "conventional-commit".
|
|
331
|
+
--release-as Release as increments the version by the specified level. [Choices: "major", "minor", "patch"]
|
|
323
332
|
|
|
324
333
|
Flags:
|
|
325
|
-
--allow-multiple-versions
|
|
326
|
-
--commit-all
|
|
327
|
-
--changelog-all
|
|
328
|
-
--debug
|
|
329
|
-
--dry-run
|
|
330
|
-
--silent
|
|
331
|
-
--git-tag-fallback
|
|
332
|
-
--sign
|
|
333
|
-
--verify
|
|
334
|
+
--allow-multiple-versions Don't throw an error if multiple versions are found in the given files. [Default: true]
|
|
335
|
+
--commit-all Commit all changes, not just files updated by Fork-Version.
|
|
336
|
+
--changelog-all If this flag is set, all default commit types will be added to the changelog.
|
|
337
|
+
--debug Output debug information.
|
|
338
|
+
--dry-run No output will be written to disk or committed.
|
|
339
|
+
--silent Run without logging to the terminal.
|
|
340
|
+
--git-tag-fallback If unable to find a version in the given files, fallback and attempt to use the latest git tag. [Default: true]
|
|
341
|
+
--sign If true, git will sign the commit with the systems GPG key.
|
|
342
|
+
--verify If true, git will run user defined git hooks before committing.
|
|
334
343
|
|
|
335
344
|
To negate a flag you can prefix it with "no-", for example "--no-git-tag-fallback" will not fallback to the latest git tag.
|
|
336
345
|
|
|
337
346
|
Skip Steps:
|
|
338
|
-
--skip-bump
|
|
339
|
-
--skip-changelog
|
|
340
|
-
--skip-commit
|
|
341
|
-
--skip-tag
|
|
347
|
+
--skip-bump Skip the version bump step.
|
|
348
|
+
--skip-changelog Skip updating the changelog.
|
|
349
|
+
--skip-commit Skip committing the changes.
|
|
350
|
+
--skip-tag Skip tagging the commit.
|
|
342
351
|
|
|
343
352
|
Conventional Changelog Overrides:
|
|
344
|
-
--commit-url-format
|
|
345
|
-
--compare-url-format
|
|
346
|
-
--issue-url-format
|
|
347
|
-
--user-url-format
|
|
348
|
-
--release-commit-message-format
|
|
349
|
-
--release-message-suffix
|
|
353
|
+
--commit-url-format Override the default commit URL format.
|
|
354
|
+
--compare-url-format Override the default compare URL format.
|
|
355
|
+
--issue-url-format Override the default issue URL format.
|
|
356
|
+
--user-url-format Override the default user URL format.
|
|
357
|
+
--release-commit-message-format Override the default release commit message format.
|
|
358
|
+
--release-message-suffix Add a suffix to the end of the release message.
|
|
350
359
|
|
|
351
360
|
Examples:
|
|
352
361
|
$ fork-version
|
|
@@ -379,6 +388,7 @@ function getCliArguments() {
|
|
|
379
388
|
preReleaseTag: { type: "string" },
|
|
380
389
|
currentVersion: { type: "string" },
|
|
381
390
|
nextVersion: { type: "string" },
|
|
391
|
+
releaseAs: { type: "string", choices: ["major", "minor", "patch"] },
|
|
382
392
|
// Flags
|
|
383
393
|
allowMultipleVersions: { type: "boolean" },
|
|
384
394
|
commitAll: { type: "boolean" },
|
|
@@ -920,16 +930,24 @@ async function getNextVersion(config, logger, currentVersion) {
|
|
|
920
930
|
const isPreMajor = semver3.lt(currentVersion, "1.0.0");
|
|
921
931
|
let recommendedBump;
|
|
922
932
|
try {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
+
if (config.releaseAs) {
|
|
934
|
+
recommendedBump = {
|
|
935
|
+
releaseType: config.releaseAs,
|
|
936
|
+
level: -1,
|
|
937
|
+
reason: "User defined"
|
|
938
|
+
};
|
|
939
|
+
} else {
|
|
940
|
+
recommendedBump = await conventionalRecommendedBump({
|
|
941
|
+
preset: {
|
|
942
|
+
name: "conventionalcommits",
|
|
943
|
+
...config.changelogPresetConfig,
|
|
944
|
+
preMajor: isPreMajor
|
|
945
|
+
},
|
|
946
|
+
path: config.path,
|
|
947
|
+
tagPrefix: config.tagPrefix,
|
|
948
|
+
cwd: config.path
|
|
949
|
+
});
|
|
950
|
+
}
|
|
933
951
|
} catch (_error) {
|
|
934
952
|
throw new Error(`[conventional-recommended-bump] Unable to determine next version`);
|
|
935
953
|
}
|
|
@@ -1080,5 +1098,5 @@ async function tagChanges(config, logger, git, nextVersion) {
|
|
|
1080
1098
|
}
|
|
1081
1099
|
|
|
1082
1100
|
export { FileManager, ForkConfigSchema, Logger, commitChanges, defineConfig, getCurrentVersion, getNextVersion, getUserConfig, tagChanges, updateChangelog };
|
|
1083
|
-
//# sourceMappingURL=chunk-
|
|
1084
|
-
//# sourceMappingURL=chunk-
|
|
1101
|
+
//# sourceMappingURL=chunk-6F6V3HWV.js.map
|
|
1102
|
+
//# sourceMappingURL=chunk-6F6V3HWV.js.map
|