autorel 1.1.5 → 2.0.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/README.md CHANGED
@@ -17,7 +17,7 @@ Autorel automatically does the following, if appropriate:
17
17
  - Publishes the package to NPM
18
18
  - Runs any arbitrary command or bash script
19
19
 
20
- _Currently only comes with built-in support for `GitHub` and `NPM`, but you can write your own scripts to support other systems._
20
+ _Currently only has built-in support for `GitHub` and `NPM`, but you can write your own scripts to support other systems and languages._
21
21
 
22
22
  **✅ Conventional Commit and SemVer Compliant**
23
23
  - 100% compliant with Conventional Commits and SemVer out of the box, including "!" for breaking changes
@@ -181,16 +181,16 @@ Whether to publish the release to NPM. If `true`, you must be authenticated with
181
181
 
182
182
  Whether to run in dry-run mode. This will not push the tag, create the release, publish to NPM, or run the command.
183
183
 
184
- - CLI: `--dry`
184
+ - CLI: `--dry-run`
185
185
  - Argument: `dryRun: boolean`
186
186
  - Default: `false`
187
187
 
188
- ## noRelease
188
+ ## skipRelease
189
189
 
190
190
  Whether to skip creating a release on GitHub. If `true`, the release will not be created, but the tag will still be pushed and the package on npm will still be updated, if applicable.
191
191
 
192
- - CLI: `--no-release`
193
- - Argument: `noRelease: boolean`
192
+ - CLI: `--skip-release`
193
+ - Argument: `skipRelease: boolean`
194
194
  - Default: `false`
195
195
 
196
196
  ## run
@@ -223,11 +223,11 @@ runScript: |
223
223
  - Argument: `runScript: string`
224
224
  - Default: `undefined`
225
225
 
226
- ## pre-release
226
+ ## preRelease
227
227
 
228
- The pre-release channel to use. This will be appended to the version number. For example, if the version is `1.0.0` and the pre-release is `alpha`, the version will be `1.0.0-alpha.1`. For "production" releases, the "latest" tag will be used for NPM.
228
+ > ❗️ This is typically set via the `branches` configuration (recommended), but can be overridden here.
229
229
 
230
- This is typically set via the `branches` configuration (recommended), but can be overridden here.
230
+ The pre-release channel to use. This will be appended to the version number. For example, if the version is `1.0.0` and the pre-release is `alpha`, the version will be `1.0.0-alpha.1`. For "production" releases, the "latest" tag will be used for NPM.
231
231
 
232
232
  - CLI: `--pre-release`
233
233
  - Argument: `preRelease: string`
@@ -248,19 +248,19 @@ The commit types to use for both the release notes and version bumping. If not p
248
248
 
249
249
  ## branches (YAML only)
250
250
 
251
- The branches to use for the release along with their channel. If not provided, the default is:
251
+ The branches to use for the release along with their pre-release channel. If not provided, the default is:
252
252
 
253
253
  ```yaml
254
254
  - {name: 'main'}
255
255
  ```
256
256
 
257
- The above will release to the `latest` channel on NPM. If you want to release to a different channel, you can specify it like so:
257
+ The above will release to the `latest` channel on NPM. If you want to release to a different channel (making it a pre-release), you can specify it like so:
258
258
 
259
259
  ```yaml
260
260
  branches:
261
261
  - {name: 'main'}
262
- - {name: 'develop', channel: 'alpha'}
263
- - {name: 'staging', channel: 'beta'}
262
+ - {name: 'develop', prereleaseChannel: 'alpha'}
263
+ - {name: 'staging', prereleaseChannel: 'beta'}
264
264
  ```
265
265
 
266
266
  The above will release to the `latest` channel (production) on NPM for the `main` branch, the `alpha` pre-release channel for the `develop` branch, and the `beta` pre-release channel for the `staging` branch.
package/dist/cli.js CHANGED
@@ -17,23 +17,29 @@ console.log('----------------------------');
17
17
  program
18
18
  .version(packageJson.version, '-v, --version')
19
19
  .description('An example CLI for managing a directory')
20
- .option('--dry', 'Do a dry run (arg: dryRun)')
20
+ .option('--dryRun', 'Do a dry run (arg: dryRun)')
21
21
  .option('--pre-release <value>', 'Pre-release channel. If specified, the release will be marked as a pre-release. Overrides branches configuration. (arg: preRelease)')
22
22
  .option('--use-version <value>', 'Specify a version to be used instead of calculating it from commit analysis. Must be a valid SemVer version, with no \'v\'. Overrides --pre-release, commitType, and branches configuration. (arg: useVersion)')
23
23
  .option('--run <value>', 'Command to run after the release is successful. (arg: run)')
24
- .option('--no-release', 'Skips creating a release on GitHub. (arg: noRelease)')
24
+ .option('--skip-release', 'Skips creating a release on GitHub. (arg: skipRelease)')
25
25
  .option('--publish', 'Publish the package to npm, requires passing --npm-token or NPM_TOKEN environment variable. (arg: publish)')
26
26
  .parse(process.argv);
27
27
  const options = program.opts();
28
28
  const cliOptions = {
29
- dryRun: options.dry,
29
+ dryRun: options.dryRun,
30
30
  run: options.run,
31
31
  prereleaseChannel: options.preRelease,
32
32
  useVersion: options.useVersion,
33
33
  publish: options.publish,
34
- noRelease: options.release === false,
34
+ skipRelease: options.skipRelease,
35
35
  };
36
36
  const config = (0, config_1.getConfig)(cliOptions);
37
+ // remove falsy values from the overrides
38
+ if (config) {
39
+ Object.keys(config).forEach((key) => (
40
+ // @ts-ignore
41
+ !config[key] && delete config[key]));
42
+ }
37
43
  output_1.default.debug(`CLI Options: ${JSON.stringify(cliOptions, null, 2)}`);
38
44
  output_1.default.debug(`Config: ${JSON.stringify(config, null, 2)}`);
39
45
  (0, _1.autorel)(config);
package/dist/config.js CHANGED
@@ -39,7 +39,7 @@ const validateConfig = rtype_1.predicates.object({
39
39
  runScript: rtype_1.predicates.optional(rtype_1.predicates.string()),
40
40
  prereleaseChannel: rtype_1.predicates.optional(rtype_1.predicates.string()),
41
41
  useVersion: rtype_1.predicates.optional(rtype_1.predicates.string()),
42
- noRelease: rtype_1.predicates.optional(rtype_1.predicates.boolean()),
42
+ skipRelease: rtype_1.predicates.optional(rtype_1.predicates.boolean()),
43
43
  publish: rtype_1.predicates.optional(rtype_1.predicates.boolean()),
44
44
  breakingChangeTitle: rtype_1.predicates.optional(rtype_1.predicates.string()),
45
45
  commitTypes: rtype_1.predicates.optional(rtype_1.predicates.array(rtype_1.predicates.object({
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export type Config = {
13
13
  runScript?: string;
14
14
  prereleaseChannel?: string;
15
15
  useVersion?: string;
16
- noRelease?: boolean;
16
+ skipRelease?: boolean;
17
17
  publish?: boolean;
18
18
  breakingChangeTitle: string;
19
19
  commitTypes: CommitType[];
package/dist/index.js CHANGED
@@ -103,7 +103,7 @@ async function autorel(args) {
103
103
  return;
104
104
  git.createAndPushTag(nextTag);
105
105
  const { owner, repository } = git.getRepo();
106
- !args.noRelease && github.createRelease({
106
+ !args.skipRelease && github.createRelease({
107
107
  token: process.env.GITHUB_TOKEN,
108
108
  owner,
109
109
  repository,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autorel",
3
- "version": "1.1.5",
3
+ "version": "2.0.0",
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)",
@@ -28,7 +28,22 @@
28
28
  "build": "rm -rf ./dist && tsc"
29
29
  },
30
30
  "homepage": "https://github.com/mhweiner/autorel/blob/main/README.md",
31
- "keywords": [],
31
+ "keywords": [
32
+ "semantic-release",
33
+ "semantic commits",
34
+ "conventional commits",
35
+ "semantic versioning",
36
+ "automatic release",
37
+ "automatic builds",
38
+ "builds",
39
+ "ci/cid",
40
+ "ci-cd",
41
+ "continuous integration",
42
+ "continuous deployment",
43
+ "automation",
44
+ "release automation",
45
+ "release-please"
46
+ ],
32
47
  "devDependencies": {
33
48
  "@types/js-yaml": "^4.0.9",
34
49
  "@types/node": "^17.0.0",