autorel 2.2.5 → 2.2.7
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/README.md +5 -1
- package/dist/lib/git.d.ts +10 -0
- package/dist/lib/git.js +11 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,6 +35,8 @@ _Currently only has built-in support for `GitHub` and `NPM`, but you can write y
|
|
|
35
35
|
- Comprehensive test coverage
|
|
36
36
|
- Less broken builds and more time to focus on your code!
|
|
37
37
|
|
|
38
|
+
[Read our FAQ on why you should use `autorel` and how it compares to other tools](docs/faq.md)
|
|
39
|
+
|
|
38
40
|
# Table of Contents
|
|
39
41
|
|
|
40
42
|
- [Example Usage (CLI)](#example-usage-cli)
|
|
@@ -74,7 +76,9 @@ autorel --publish
|
|
|
74
76
|
|
|
75
77
|
## Avoiding Breaking Changes
|
|
76
78
|
|
|
77
|
-
|
|
79
|
+
If using the `npx` command, you may want to append the version number to prevent breaking changes in the future. You can do this by appending `@^` followed by the major version number.
|
|
80
|
+
|
|
81
|
+
Example: `npx autorel@^2`
|
|
78
82
|
|
|
79
83
|
# Example Usage (Library)
|
|
80
84
|
|
package/dist/lib/git.d.ts
CHANGED
|
@@ -4,6 +4,16 @@ export type Commit = {
|
|
|
4
4
|
};
|
|
5
5
|
export declare function gitFetchTags(): void;
|
|
6
6
|
export declare function createAndPushTag(tag: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Get the last tag. It does this by:
|
|
9
|
+
* 1. Getting all tags
|
|
10
|
+
* 2. Filtering out tags that are not in the format v1.2.3
|
|
11
|
+
* 3. Sorting the tags by version number by tricking the sort -V command by appending an
|
|
12
|
+
* underscore to tags that do not have a hyphen in them (i.e. they are not pre-release tags)
|
|
13
|
+
* Thanks to this StackOverflow answer: https://stackoverflow.com/questions/40390957/how-to-sort-semantic-versions-in-bash
|
|
14
|
+
* 4. Removing the underscore from the sorted tags
|
|
15
|
+
* 5. Getting the last tag
|
|
16
|
+
*/
|
|
7
17
|
export declare function getLastTag(): string;
|
|
8
18
|
export declare function getLastProdTag(): string;
|
|
9
19
|
export declare function getRepo(): {
|
package/dist/lib/git.js
CHANGED
|
@@ -11,8 +11,18 @@ function createAndPushTag(tag) {
|
|
|
11
11
|
(0, sh_1.$) `git push origin ${tag}`;
|
|
12
12
|
}
|
|
13
13
|
exports.createAndPushTag = createAndPushTag;
|
|
14
|
+
/**
|
|
15
|
+
* Get the last tag. It does this by:
|
|
16
|
+
* 1. Getting all tags
|
|
17
|
+
* 2. Filtering out tags that are not in the format v1.2.3
|
|
18
|
+
* 3. Sorting the tags by version number by tricking the sort -V command by appending an
|
|
19
|
+
* underscore to tags that do not have a hyphen in them (i.e. they are not pre-release tags)
|
|
20
|
+
* Thanks to this StackOverflow answer: https://stackoverflow.com/questions/40390957/how-to-sort-semantic-versions-in-bash
|
|
21
|
+
* 4. Removing the underscore from the sorted tags
|
|
22
|
+
* 5. Getting the last tag
|
|
23
|
+
*/
|
|
14
24
|
function getLastTag() {
|
|
15
|
-
return (0, sh_1.$) `git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1` || '';
|
|
25
|
+
return (0, sh_1.$) `git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | sed '/-/!s/$/_/' | sort -V | sed 's/_$//' | tail -n 1` || '';
|
|
16
26
|
}
|
|
17
27
|
exports.getLastTag = getLastTag;
|
|
18
28
|
function getLastProdTag() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autorel",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.7",
|
|
4
4
|
"description": "Automate semantic releases based on conventional commits. Similar to semantic-release but much simpler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc H. Weiner <mhweiner234@gmail.com> (https://mhweiner.com)",
|