autorel 2.3.0-next.4 → 2.3.1
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 +38 -48
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ _Currently only has built-in support for `GitHub` and `NPM`, but you can write y
|
|
|
39
39
|
|
|
40
40
|
[Read our FAQ on why you should use `autorel` and how it compares to other tools](docs/faq.md)
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
## Table of Contents
|
|
43
43
|
|
|
44
44
|
- [Example Usage (CLI)](#example-usage-cli)
|
|
45
45
|
- [Example Usage (Library)](#example-usage-library)
|
|
@@ -57,7 +57,7 @@ _Currently only has built-in support for `GitHub` and `NPM`, but you can write y
|
|
|
57
57
|
- [Support, Feedback, and Contributions](#support-feedback-and-contributions)
|
|
58
58
|
- [License](#license)
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
## Example Usage (CLI)
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
63
|
npx autorel --publish --run 'echo "Next version is ${NEXT_VERSION}"'
|
|
@@ -77,13 +77,13 @@ npm i -g autorel
|
|
|
77
77
|
autorel --publish
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
### Avoiding Breaking Changes
|
|
81
81
|
|
|
82
82
|
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.
|
|
83
83
|
|
|
84
84
|
Example: `npx autorel@^2`
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
## Example Usage (Library)
|
|
87
87
|
|
|
88
88
|
1. Install `autorel` as a dependency
|
|
89
89
|
|
|
@@ -91,17 +91,22 @@ Example: `npx autorel@^2`
|
|
|
91
91
|
npm i autorel
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
2. Import and use in your project
|
|
94
|
+
2. Import and use in your project to build custom release tooling
|
|
95
95
|
|
|
96
96
|
```typescript
|
|
97
|
-
import {autorel} from 'autorel';
|
|
97
|
+
import {autorel, defaultConfig} from 'autorel';
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
const autorelConfig = {
|
|
100
|
+
...defaultConfig,
|
|
101
|
+
publish: true,
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
autorel(autorelConfig).then((nextVersion) => {
|
|
100
105
|
console.log(`Next version is ${nextVersion}`);
|
|
101
106
|
});
|
|
102
107
|
```
|
|
103
108
|
|
|
104
|
-
|
|
109
|
+
## System Requirements
|
|
105
110
|
|
|
106
111
|
- Linux or MacOS (Windows is not officially supported)
|
|
107
112
|
- Node.js 14+
|
|
@@ -109,7 +114,7 @@ Example: `npx autorel@^2`
|
|
|
109
114
|
- Git 2.13+
|
|
110
115
|
- Bash
|
|
111
116
|
|
|
112
|
-
|
|
117
|
+
## Commit Messages
|
|
113
118
|
|
|
114
119
|
Commit messages are parsed to determine the version bump. They must follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard specification.
|
|
115
120
|
|
|
@@ -121,7 +126,7 @@ Here are some examples of commit messages and the resulting [SemVer](https://sem
|
|
|
121
126
|
|
|
122
127
|
You can find more examples in the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) documentation.
|
|
123
128
|
|
|
124
|
-
|
|
129
|
+
## Usage with GitHub Actions
|
|
125
130
|
|
|
126
131
|
You can use `autorel` with GitHub Actions to automate your releases (recommended).
|
|
127
132
|
|
|
@@ -158,7 +163,7 @@ jobs:
|
|
|
158
163
|
|
|
159
164
|
It's also recommended you create a `.autorel.yaml` file in the root of your project to [configure](#configuration) `autorel`.
|
|
160
165
|
|
|
161
|
-
|
|
166
|
+
## Usage with Other Repositories (not GitHub)
|
|
162
167
|
|
|
163
168
|
`autorel` is designed to work with any CI/CD system, not just GitHub Actions. You can use it with GitLab, Bitbucket, Jenkins, or any other system that supports running shell commands.
|
|
164
169
|
|
|
@@ -166,7 +171,7 @@ Simply use the `--skip-release` flag (arg: `skipRelease: true`) to skip creating
|
|
|
166
171
|
|
|
167
172
|
If you're interested in contributing built-in support for other systems, please open an issue or PR.
|
|
168
173
|
|
|
169
|
-
|
|
174
|
+
## Usage with Other Languages (not Node.js)
|
|
170
175
|
|
|
171
176
|
`autorel` is designed to work with any language or platform. You can use it with Python, Ruby, Go, Java, or any other language.
|
|
172
177
|
|
|
@@ -174,7 +179,7 @@ Simply omit the `--publish` flag (arg: `publish: false`, which is default) to sk
|
|
|
174
179
|
|
|
175
180
|
If you're interested in contributing built-in support for other systems, please open an issue or PR.
|
|
176
181
|
|
|
177
|
-
|
|
182
|
+
## Configuration
|
|
178
183
|
|
|
179
184
|
When run in CLI mode, `autorel` can be configured via CLI arguments or a `yaml` file. CLI arguments take precedence over the `yaml` file.
|
|
180
185
|
|
|
@@ -188,7 +193,7 @@ All arguments are optional.
|
|
|
188
193
|
|
|
189
194
|
[See sample YAML configuration](#sample-yaml-configuration)
|
|
190
195
|
|
|
191
|
-
|
|
196
|
+
### publish
|
|
192
197
|
|
|
193
198
|
Whether to publish the release to NPM. If `true`, you must be authenticated with NPM. To do so via GitHub Actions, see [this](https://docs.github.com/en/actions/guides/publishing-nodejs-packages#publishing-packages-to-the-npm-registry).
|
|
194
199
|
|
|
@@ -196,7 +201,7 @@ Whether to publish the release to NPM. If `true`, you must be authenticated with
|
|
|
196
201
|
- Argument: `publish: boolean`
|
|
197
202
|
- Default: `false`
|
|
198
203
|
|
|
199
|
-
|
|
204
|
+
### dryRun
|
|
200
205
|
|
|
201
206
|
Whether to run in dry-run mode. This will not push the tag, create the release, publish to NPM, or run the command.
|
|
202
207
|
|
|
@@ -204,7 +209,7 @@ Whether to run in dry-run mode. This will not push the tag, create the release,
|
|
|
204
209
|
- Argument: `dryRun: boolean`
|
|
205
210
|
- Default: `false`
|
|
206
211
|
|
|
207
|
-
|
|
212
|
+
### skipRelease
|
|
208
213
|
|
|
209
214
|
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.
|
|
210
215
|
|
|
@@ -212,7 +217,7 @@ Whether to skip creating a release on GitHub. If `true`, the release will not be
|
|
|
212
217
|
- Argument: `skipRelease: boolean`
|
|
213
218
|
- Default: `false`
|
|
214
219
|
|
|
215
|
-
|
|
220
|
+
### run
|
|
216
221
|
|
|
217
222
|
A `bash` command/script to run after the release is complete. All scripts are run in "-e" mode, meaning they will exit on the first error.
|
|
218
223
|
|
|
@@ -247,7 +252,7 @@ run: |
|
|
|
247
252
|
- Argument: `run: string`
|
|
248
253
|
- Default: `undefined`
|
|
249
254
|
|
|
250
|
-
|
|
255
|
+
### preRun
|
|
251
256
|
|
|
252
257
|
A `bash` command/script to run before the release is started. All scripts are run in "-e" mode, meaning they will exit on the first error. Here's where you can do things like run tests or do build steps.
|
|
253
258
|
|
|
@@ -269,7 +274,7 @@ preRun: |
|
|
|
269
274
|
- Argument: `preRun: string`
|
|
270
275
|
- Default: `undefined`
|
|
271
276
|
|
|
272
|
-
|
|
277
|
+
### preRelease
|
|
273
278
|
|
|
274
279
|
> ❗️ This is typically set via the `branches` configuration (recommended), but can be overridden here.
|
|
275
280
|
|
|
@@ -279,21 +284,21 @@ The pre-release channel to use. This will be appended to the version number. For
|
|
|
279
284
|
- Argument: `preRelease: string`
|
|
280
285
|
- Default: `undefined`
|
|
281
286
|
|
|
282
|
-
|
|
287
|
+
### breakingChangeTitle (YAML/library only)
|
|
283
288
|
|
|
284
289
|
The title to use for the breaking changes section in the release notes.
|
|
285
290
|
|
|
286
291
|
- Argument: `breakingChangeTitle: string`
|
|
287
292
|
- Default: `"🚨 Breaking Changes 🚨"`
|
|
288
293
|
|
|
289
|
-
|
|
294
|
+
### commitTypes (YAML/library only)
|
|
290
295
|
|
|
291
296
|
The commit types to use for both the release notes and version bumping.
|
|
292
297
|
|
|
293
298
|
- Argument: `commitTypes: CommitType[]`
|
|
294
299
|
- Defaults: [src/defaults.ts](src/defaults.ts)
|
|
295
300
|
|
|
296
|
-
|
|
301
|
+
### branches (YAML/library only)
|
|
297
302
|
|
|
298
303
|
The branches to use for the release along with their pre-release channel. If not provided, the default is:
|
|
299
304
|
|
|
@@ -314,7 +319,7 @@ The above will release to the `latest` channel (production) on NPM for the `main
|
|
|
314
319
|
|
|
315
320
|
- Argument: `branches: ReleaseBranch[]`
|
|
316
321
|
|
|
317
|
-
|
|
322
|
+
### useVersion
|
|
318
323
|
|
|
319
324
|
The version to use for the release INSTEAD of the version being generated. Always results in a release being created unless `noRelease` is `true`. **Advanced usage only, not recommended for most users.**
|
|
320
325
|
|
|
@@ -324,7 +329,7 @@ The version to use for the release INSTEAD of the version being generated. Alway
|
|
|
324
329
|
|
|
325
330
|
> ❗️ Must be a valid SemVer version, without the `v`.
|
|
326
331
|
|
|
327
|
-
|
|
332
|
+
## Sample YAML Configuration
|
|
328
333
|
|
|
329
334
|
<sub>_.autorel.yaml_</sub>
|
|
330
335
|
```yaml
|
|
@@ -342,11 +347,11 @@ run: |
|
|
|
342
347
|
aws s3 sync . s3://my-bucket
|
|
343
348
|
```
|
|
344
349
|
|
|
345
|
-
|
|
350
|
+
## Types
|
|
346
351
|
|
|
347
352
|
You can find the types defined at [src/index.ts](src/index.ts).
|
|
348
353
|
|
|
349
|
-
|
|
354
|
+
## Debug Mode
|
|
350
355
|
|
|
351
356
|
To enable debug mode, set `AUTOREL_DEBUG=1`:
|
|
352
357
|
|
|
@@ -356,40 +361,25 @@ AUTOREL_DEBUG=1 npx autorel
|
|
|
356
361
|
|
|
357
362
|
This will output configuration and other debug information.
|
|
358
363
|
|
|
359
|
-
|
|
364
|
+
## About package.json versions
|
|
360
365
|
|
|
361
366
|
If using our npm publishing feature, the package.json file's version will be updated in memory before being pushed to npm, as this is the only place where it's actually required. The change will not be pushed to the repository, as it is not necessary and could cause conflicts. See [this post](https://semantic-release.gitbook.io/semantic-release/support/faq)
|
|
362
367
|
|
|
363
368
|
If you need access to the new version number in your CI/CD pipeline, you can use the `NEXT_VERSION` or `NEXT_TAG` environment variables.
|
|
364
369
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
- Star this repo if you like it!
|
|
368
|
-
- Submit an [issue](https://github.com/mhweiner/autorel/issues) with your problem, feature request or bug report
|
|
369
|
-
- Issue a PR against `main` and request review. Make sure all tests pass and coverage is good.
|
|
370
|
-
- Write about this project in your blog, tweet about it, or share it with your friends!
|
|
371
|
-
|
|
372
|
-
# Sponsorship
|
|
373
|
-
<br>
|
|
374
|
-
<picture>
|
|
375
|
-
<source srcset="docs/aeroview-white.svg" media="(prefers-color-scheme: dark)">
|
|
376
|
-
<source srcset="docs/aeroview-black.svg" media="(prefers-color-scheme: light)">
|
|
377
|
-
<img src="docs/aeroview-black.svg" alt="Logo" height="20">
|
|
378
|
-
</picture>
|
|
379
|
-
<br>
|
|
380
|
-
|
|
381
|
-
Aeroview is a lightning-fast, developer-friendly, and AI-powered logging IDE. Get started for free at [https://aeroview.io](https://aeroview.io).
|
|
370
|
+
## Contributing
|
|
382
371
|
|
|
383
|
-
|
|
372
|
+
- ⭐ Star this repo if you like it!
|
|
373
|
+
- 🐛 Open an [issue](https://github.com/mhweiner/autorel/issues) for bugs or suggestions.
|
|
374
|
+
- 🤝 Submit a PR to `main` — all tests must pass.
|
|
384
375
|
|
|
385
|
-
|
|
376
|
+
## Other useful libraries
|
|
386
377
|
|
|
387
378
|
- [brek](https://github.com/mhweiner/brek): powerful yet simple configuration library for Node.js. It’s structured, typed, and designed for dynamic configuration loading, making it perfect for securely managing secrets (e.g., AWS Secrets Manager).
|
|
388
379
|
- [hoare](https://github.com/mhweiner/hoare): An easy-to-use, fast, and defensive JS/TS test runner designed to help you to write simple, readable, and maintainable tests.
|
|
389
380
|
- [jsout](https://github.com/mhweiner/jsout): A Syslog-compatible, small, and simple logger for Typescript/Javascript projects.
|
|
390
381
|
- [cjs-mock](https://github.com/mhweiner/cjs-mock): NodeJS module mocking for CJS (CommonJS) modules for unit testing purposes.
|
|
391
|
-
- [typura](https://github.com/aeroview/typura): Simple and extensible runtime input validation for TS/JS, written in TS.
|
|
392
382
|
|
|
393
|
-
|
|
383
|
+
## License
|
|
394
384
|
|
|
395
385
|
[MIT](LICENSE)
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -22,6 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
25
28
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
29
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
30
|
};
|
|
@@ -148,4 +151,6 @@ async function autorel(args) {
|
|
|
148
151
|
return nextTag.replace('v', '');
|
|
149
152
|
}
|
|
150
153
|
exports.autorel = autorel;
|
|
154
|
+
__exportStar(require("./defaults"), exports);
|
|
155
|
+
__exportStar(require("./config"), exports);
|
|
151
156
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autorel",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
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)",
|