autorel 0.0.19 → 0.0.21

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 CHANGED
@@ -30,11 +30,12 @@ Autorel automatically does the following, if appropriate:
30
30
  **💪 Flexible & Powerful**
31
31
  - Use via `npx`, or import as a library
32
32
  - If using CLI, supports both `yaml` configuration and arguments
33
+ - Highly customizable without being overly complex
33
34
 
34
35
  # Example Usage (CLI)
35
36
 
36
37
  ```bash
37
- npx autorel --publish --run "echo 'Hello, World!'"
38
+ npx autorel --publish --run "echo \"Next version is ${NEXT_VERSION}!\""
38
39
  ```
39
40
 
40
41
  This will:
@@ -42,13 +43,13 @@ This will:
42
43
  1. Bump the version based on the commit messages since the last release (including pushing the tag and updating package.json)
43
44
  2. Create a new release on GitHub with Release Notes
44
45
  3. Publish the release to NPM
45
- 4. Run the command `echo 'Hello, World!'`
46
+ 4. Run the command `echo "Next version is ${NEXT_VERSION}!"`
46
47
 
47
48
  You can also install `autorel` globally and run it that way:
48
49
 
49
50
  ```bash
50
51
  npm i -g autorel
51
- autorel --publish --run "echo 'Hello, World!'"
52
+ autorel --publish
52
53
  ```
53
54
 
54
55
  # Example Usage (Library)
@@ -113,7 +114,12 @@ Whether to skip creating a release on GitHub. If `true`, the release will not be
113
114
 
114
115
  ## run
115
116
 
116
- A command to run after the release is complete. This will be run via `child_process`.
117
+ A command to run after the release is complete. This will be run via `child_process`. The following environment variables are available:
118
+
119
+ | Variable | Description |
120
+ | --- | --- |
121
+ | `NEXT_VERSION` | The next version number (without the `v`) |
122
+ | `NEXT_TAG` | The next tag |
117
123
 
118
124
  - CLI: `--run`
119
125
  - Argument: `run: string`
@@ -121,10 +127,7 @@ A command to run after the release is complete. This will be run via `child_proc
121
127
 
122
128
  ## runScript (YAML only)
123
129
 
124
- A bash script to run after the release is complete. This will be run via `bash` and `child_process`.
125
-
126
- - Argument: `runScript: string`
127
- - Default: `undefined`
130
+ A bash script to run after the release is complete. This will be run via `bash` and `child_process`. Environment variables are available as above.
128
131
 
129
132
  > This requires `bash` to be installed on the system.
130
133
 
@@ -136,6 +139,9 @@ runScript: |
136
139
  echo 'Goodbye, World!' > goodbye.txt
137
140
  ```
138
141
 
142
+ - Argument: `runScript: string`
143
+ - Default: `undefined`
144
+
139
145
  ## tag
140
146
 
141
147
  The tag to use for the release. This will be used verbatim, instead of being generated from the version number. Always results in a release being created unless `noRelease` is `true`. **Advanced usage only.**
@@ -200,59 +206,14 @@ run: echo 'Hello, World!'
200
206
 
201
207
  # Types
202
208
 
203
- ## CommitType
204
-
205
- ```typescript
206
- type CommitType = {
207
- type: string;
208
- title: string;
209
- release: 'major' | 'minor' | 'patch' | 'none';
210
- };
211
- ```
212
-
213
- ## ReleaseBranch
214
-
215
- ```typescript
216
- type ReleaseBranch = {
217
- name: string;
218
- channel?: string;
219
- };
220
- ```
221
-
222
- ## Config
223
-
224
- ```typescript
225
- type Config = {
226
- run?: string;
227
- publish?: boolean;
228
- dryRun?: boolean;
229
- noRelease?: boolean;
230
- tag?: string;
231
- pre?: string;
232
- breakingChangeTitle?: string;
233
- commitTypes?: CommitType[];
234
- branches?: ReleaseBranch[];
235
- };
236
- ```
237
-
238
- ## Contribution
239
-
240
- Please contribute to this project! Issue a PR against `main` and request review.
241
-
242
- - Please test your work thoroughly.
243
- - Make sure all tests pass with appropriate coverage.
209
+ You can find the types defined at [src/index.ts](src/index.ts).
244
210
 
245
- ### How to build locally
211
+ # Support, Feedback, and Contributions
246
212
 
247
- ```bash
248
- npm i
249
- ```
250
-
251
- ### Running tests
252
-
253
- ```shell script
254
- npm test
255
- ```
213
+ - Star this repo if you like it!
214
+ - Submit an [issue](https://github.com/mhweiner/jsout/issues) with your problem, feature request or bug report
215
+ - Issue a PR against `main` and request review. Make sure all tests pass and coverage is good.
216
+ - Write about `autorel` in your blog, tweet about it, or share it with your friends!
256
217
 
257
218
  ## Sponors
258
219
 
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ const github = __importStar(require("./services/github"));
38
38
  const output_1 = __importDefault(require("./lib/output"));
39
39
  const config_1 = require("./config");
40
40
  const versionBump_1 = require("./versionBump");
41
- const bash_1 = require("./lib/bash");
41
+ const sh_1 = require("./lib/sh");
42
42
  function getPrereleaseChannel(args) {
43
43
  if (args.prereleaseChannel)
44
44
  return args.prereleaseChannel;
@@ -117,7 +117,7 @@ async function autorel(args) {
117
117
  output_1.default.log(args.run);
118
118
  output_1.default.log('----------------------------');
119
119
  output_1.default.log('');
120
- (0, bash_1.cmd)(args.run);
120
+ (0, sh_1.cmd)(args.run);
121
121
  }
122
122
  else if (args.runScript) {
123
123
  output_1.default.log('Running post-release bash script:');
@@ -126,7 +126,7 @@ async function autorel(args) {
126
126
  output_1.default.log(args.runScript);
127
127
  output_1.default.log('----------------------------');
128
128
  output_1.default.log('');
129
- (0, bash_1.bash)(args.runScript);
129
+ (0, sh_1.bash)(args.runScript);
130
130
  }
131
131
  }
132
132
  exports.autorel = autorel;
package/dist/lib/git.js CHANGED
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCurrentBranch = exports.getCommitsSinceLastTag = exports.getRepo = exports.getLastProdTag = exports.getLastTag = exports.createAndPushTag = void 0;
4
- const bash_1 = require("./bash");
4
+ const sh_1 = require("./sh");
5
5
  function createAndPushTag(tag) {
6
- (0, bash_1.$) `git tag ${tag}`;
7
- (0, bash_1.$) `git push origin ${tag}`;
6
+ (0, sh_1.$) `git tag ${tag}`;
7
+ (0, sh_1.$) `git push origin ${tag}`;
8
8
  }
9
9
  exports.createAndPushTag = createAndPushTag;
10
10
  function getLastTag() {
11
- return (0, bash_1.$) `git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1` || '';
11
+ return (0, sh_1.$) `git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1` || '';
12
12
  }
13
13
  exports.getLastTag = getLastTag;
14
14
  function getLastProdTag() {
15
- return (0, bash_1.$) `git tag --list | grep -E "^v[0-9]+\\.[0-9]+\\.[0-9]+$" | sort -V | tail -n 1` || '';
15
+ return (0, sh_1.$) `git tag --list | grep -E "^v[0-9]+\\.[0-9]+\\.[0-9]+$" | sort -V | tail -n 1` || '';
16
16
  }
17
17
  exports.getLastProdTag = getLastProdTag;
18
18
  function getRepo() {
@@ -20,7 +20,7 @@ function getRepo() {
20
20
  const [owner, repository] = process.env.GITHUB_REPOSITORY.split('/');
21
21
  return { owner, repository };
22
22
  }
23
- const url = (0, bash_1.$) `git remote get-url origin`;
23
+ const url = (0, sh_1.$) `git remote get-url origin`;
24
24
  const regex = /^git@github\.com:(.+)\/(.+)\.git$/;
25
25
  const matches = url.match(regex);
26
26
  if (!matches)
@@ -33,8 +33,8 @@ exports.getRepo = getRepo;
33
33
  function getCommitsSinceLastTag(lastTag) {
34
34
  const format = '<commit><hash>%h</hash><message>%B</message></commit>';
35
35
  const rawLog = lastTag !== ''
36
- ? (0, bash_1.$) `git log --pretty=format:"${format}" ${lastTag}..HEAD`
37
- : (0, bash_1.$) `git log --pretty=format:"${format}"`;
36
+ ? (0, sh_1.$) `git log --pretty=format:"${format}" ${lastTag}..HEAD`
37
+ : (0, sh_1.$) `git log --pretty=format:"${format}"`;
38
38
  const commitsXml = rawLog.match(/<commit>.*?<\/commit>/gs);
39
39
  if (!commitsXml)
40
40
  return [];
@@ -46,7 +46,7 @@ function getCommitsSinceLastTag(lastTag) {
46
46
  }
47
47
  exports.getCommitsSinceLastTag = getCommitsSinceLastTag;
48
48
  function getCurrentBranch() {
49
- return (0, bash_1.$) `git rev-parse --abbrev-ref HEAD`;
49
+ return (0, sh_1.$) `git rev-parse --abbrev-ref HEAD`;
50
50
  }
51
51
  exports.getCurrentBranch = getCurrentBranch;
52
52
  //# sourceMappingURL=git.js.map
package/dist/lib/npm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.publishPackage = void 0;
4
- const bash_1 = require("./bash");
4
+ const sh_1 = require("./sh");
5
5
  function publishPackage(channel) {
6
- (0, bash_1.$) `npm publish --tag ${channel || 'latest'}`;
6
+ (0, sh_1.$) `npm publish --tag ${channel || 'latest'}`;
7
7
  }
8
8
  exports.publishPackage = publishPackage;
9
9
  //# sourceMappingURL=npm.js.map
@@ -23,4 +23,4 @@ function cmd(cmd) {
23
23
  (0, child_process_1.execSync)(cmd, { encoding: 'utf8', stdio: 'inherit' });
24
24
  }
25
25
  exports.cmd = cmd;
26
- //# sourceMappingURL=bash.js.map
26
+ //# sourceMappingURL=sh.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autorel",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
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)",
File without changes